I have noticed that when I change rails project files such as a html.erb
or .css
, I don\'t have to restart the server with the rails -s
You will generally need to restart your server whenever a gem is installed or updated, if you upgrade ruby, or if you change some logic that runs during boot time (like config/boot.rb or config/database.yml). Otherwise it's generally ok not to, even if you edit/add models/controllers.
Side note: the jquery-rails gem makes adding jquery to a project easy.
In development you need to restart when:
Gemfile
.rvm
.config/
, although routes.rb
is reloaded for you.require
manually, rather than autoloading.In production you need to restart when:
N.B. These behaviours can be changed by editing the respective environment/<env>.rb
file if desired, although the defaults are sensible.
You need to restart you server when you need Rails to be loaded again from the start.
If you're adding or removing gems, then yes, you will need to restart the server.
If you change your version of ruby, change your Gemfile or change something from internal classes of Rails, you will need to restart it, otherwise it should be ok. But if unexpected problems arise, restart the server is the first thing you should try.
Also, on a side-note, you will only see the changes just refreshing the page if config.cache_classes
is set to false
(which I think is the default for development, but not for production).
Edit:
Just to make sure everyone will notice, tadman said one wise thing at the comments, The general rule of thumb here is making changes to anything outside of app/ or config/routes.rb or db/ will require a restart.