Restarting Rails without SSH access
Published December 20th, 2005 in Ruby on RailsThis came in handy earlier today when I was fixing a bug on one of my apps.
If you need to restart your Rails application, but you don’t have SSH access, you can do it by
changing the following line in your dispatch.cgi (or dispatch.fcgi, depending on which you use) file:
Change:
RailsFCGIHandler.process!
to
RailsFCGIHandler.process! nil, 1
This tells Rails to run the garbage collector and restart your app after each request (if you put the number 2 in there, it’d be two requests, etc.)
Then load your site. Now you can go back into your dispatcher file and change the setting back to normal.
This is especially useful if you’ve got your site in production mode and you want to see the effects of a quick bugfix right away.
Hey, while you’re here, you should check out my new online grading application, Teacher!. I think you’ll like it.
No Responses to “Restarting Rails without SSH access”
Please Wait
Leave a Reply