Vamsi
Vamsi

Reputation: 278

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.

Upvotes: 3

Views: 2317

Answers (3)

Amit Acharya
Amit Acharya

Reputation: 461

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

Upvotes: 1

Vlad Zloteanu
Vlad Zloteanu

Reputation: 8512

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

Upvotes: 3

shingara
shingara

Reputation: 46914

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.

Upvotes: 0

Related Questions