It should not be necessary to restart Rails server after any normal change. However, when I make little changes on my app controllers, they aren\'t applied if I don\'t resta
You can use nodemon for auto restarting your old rails applications.
1) Install nodemon.
sudo npm install -g nodemon
2) Create nodemon.json file on root dir and configure it
{
"ignore": [
".git",
"node_modules/**/node_modules"
],
"watch": [
"app/controllers/",
"app/models/",
"app/assets/",
"config/",
"db/"
],
"ext": "rb yml js css scss"
}
3) Create rails.sh file on root dir to start rails application using nodemon.
kill -9 `cat tmp/pids/server.pid`
echo "APP READY!!!"
echo "Ruby on Rails"
rails s -d
4) Give permission to rails.sh
file.
sudo chmod +x rails.sh
5) Start server using sh
command.
nodemon -L --exec "./rails.sh"
Note: Steps verified on mac machine. different os may have different command or configuration.