Skip to content
This repository was archived by the owner on Feb 7, 2020. It is now read-only.

Code Reloading

botanicus edited this page Sep 13, 2010 · 13 revisions

This page is up to date for Rango 0.2.

Implementation

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.

Issues

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.

Others Solutions

Rack::Reloader

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.

Phusion Passenger

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.

Clone this wiki locally