开发者

Rails Application expecting me to restart my webrick server for any change in my controller

I am working on an existing Rails 2.3.x application, So I was working开发者_开发技巧 on it and it was a messy code with great difficulty I was able to run the application. But now for every small change in one of my controller it is expecting me to restart my serer otherwise the changes are not reflecting back, Let's take an example scenario here, Let's just say in one of the before_filter method I just added a puts statement on top of the method and it was not printing in the log, after I restart the server it is printing, Can some one please let me know if I am missing something here.


What environment are you using?

The default environment is 'development', where the code is reloaded on each request. However, this behaviour can be overwritten in the config file.

To be sure that the code is reloaded, add this into your config/development.rb file:

  # In the development environment your application's code is reloaded on
  # every request.  This slows down response time but is perfect for development
  # since you don't have to restart the webserver when you make code changes.
  config.cache_classes = false


If you are using config.threadsafe! It needs to be present before config.cache_classes=false as threadsafe makes cache_classes true again, following link would make it more clear. here


Maybe you have don't flush. The log system in Rails use a BufferedLogger. So need a flush to be print. Try a default logger.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜