开发者

How to disable caching in Rails?

开发者 https://www.devze.com 2022-12-13 06:39 出处:网络
How can I disable caching for my rails site? I\'m running Passenger 开发者_如何学Python(mod_rails) and my site is running in \'development\' mode:

How can I disable caching for my rails site?

I'm running Passenger 开发者_如何学Python(mod_rails) and my site is running in 'development' mode:

'ENV['RAILS_ENV'] ||= 'development'

Any help?


By default Passenger will set RAILS_ENV to 'production'. The line ENV['RAILS_ENV'] ||= 'development' will only cause the Rails environment to be set to 'development' if it has not already set.

You need to add RailsEnv development to your virtual host configuration for the site to make Passenger run Rails in the development environment.


Okay, so I'll answer this question in case anybody else runs into the same problem. Basically, mod_rails was ignoring my 'development' setting that I had set in the environment.rb file. Adding this to my virtualhost configuration for my site fixed it, however:

RailsEnv "development"

See this link for more details.

Hope that helps somebody else!

0

精彩评论

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