Rails server takes a long time to start
I was working on a Rails project, but so far I was oblivious to the fact that my computer battery died while the rails server was still running.
Now when I type rails s
, the rails server is taking a very long time to start up. I calculated it for about 40 seconds. It's not that long ago.
I tried looking for other answers, but nothing really worked.
Any help is appreciated, thanks.
I have a Macbook Pro 2010, Rails 4.2.0 running
source to share
You can set the eager_loading and cache_control values ββto false, and then it will take a few seconds for the server to start
- go to development.rb file
- "config.cache_classes" and "config.eager_load" become false
Note. Setting cache_control to false gradually increases server load times ( in a development environment ) because you don't need to restart the web server when you make changes to your code. Setting eager_load to false will increase the server load time from 2 seconds to 10 seconds, but this can lead to inconsistencies, so use it wisely.
source to share