-
Notifications
You must be signed in to change notification settings - Fork 8
Code Reloading
This page is up to date for Rango 0.2.
Rango should have code reloading in development environment thanks to shotgun. Shotgun provides bin/shotgun executable which can be used instead of bin/rackup. Since Rango boot process use ./config.ru as an executable which calls init.rb, you can find the code which take care about code reloading at the bottom of your init.rb. Nothing fancy, it just loads bin/shotgun in development environment, that’s it.
It seems to be working quite well, but sometimes it has some troubles. If it doesn’t work for you, try to use other server (change shebang in your config.ru). Thin should be fine, but the latest Thin seems to have some problems on my machine.
Rack includes Rack::Reloader middleware, so everything you need is put use Rack::Reloader to your config.ru. Unfortunately it doesn’t work for me, I don’t know why.
If you’re using Phusion Passenger, you can also create the file tmp/always_restart.txt to have it automatically restart the app at every request, so you can use Passenger even for local development.