Reputation: 675
I'm hosting a Rails 4 app on an ec2 instance and using Nginx, I added a view to a controller and was getting an error trying to navigate to the page through my browser till I reloaded nginx.conf. Once it came up I made some changes to the view but those weren't showing either till I reloaded nginx.conf again.
Obviously I don't want to reload nginx.conf every time I need to change a view. Is there something I'm missing to make this easier on myself?
Here is my nginx.conf file.
server {
listen 80;
server_name app-on-rails;
passenger_enabled on;
#charset koi8-r;
#access_log logs/host.access.log main;
root /home/usr/www/app-on-rails/welcome;
index index.html.erb;
}
My environments/production.rb file
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = false
config.assets.js_compressor = :uglifier
config.assets.compile = true
Upvotes: 0
Views: 2014
Reputation: 3
In your environments/production.rb
file, you may change the following line
config.cache_classes = false
This configuration determines, the ruby classes will not be cached. So your changes in code will reflect on refreshing the browser.
As the classes are not cached, performance will be somewhat decreased. So, after your development, this below might be set to true
.
Upvotes: 0
Reputation: 35531
Your nginx config appears to be using passenger. By default, in production mode all file content is parsed once, and cached in memory - so changes will not be immediately noticeable. To force a refresh, you need to at a minimum restart passenger. This can be done by simply touching the tmp/restart.txt file in your application root directory.
Upvotes: 2