1

While developing a Rails app, I usually leave the dev server running locally (mongrel) as I work on the code. Changes in the code take affect after a quick refresh. EXCEPT changes havent been taking effect for a class I've been writing in the Lib in folder. Is this in any way a known problem? What could be causing this? It is very frustrating to work on a problem for a while, having no solutions work, only to find out none of those solutions even had a chance to work.

Thanks for any help.

4

2 回答 2

1

我发现 Rails 开发服务器(我使用 WEBrick)不会自动重新扫描某些文件夹以进行更改。vendor/plugins 文件夹是我肯定知道的文件夹,但我似乎记得在修改 lib 文件夹中的内容时遇到了麻烦。

基本上,每当我在应用程序之外修改某些内容时,我都会重新启动开发服务器。

于 2009-07-17T20:44:04.630 回答
0

在 PHP 应用程序代码中,每次请求都会重新加载,这就是为什么您需要像 APC 这样的东西来使其快速。Rails 有一个不同的模型,应用程序启动一次就可以处理多个请求。

Rails 中有一个特殊功能可以重新加载已更改的文件,但仅限于几个目录。此外,它不会处理启动期间调用的代码更改(如 environment.rb 或插件)。在这种情况下,您必须重新启动服务器。

通过以下配置选项,在开发环境中默认启用类重载功能

config.cache_classes = false
于 2009-07-17T20:54:29.677 回答