I am using
# my_app.rb
load 'index.rb'
and start the sever like this
ruby my_app.rb
but it never reload any changes I made in index page.
Did I miss anything here?
I am using
# my_app.rb
load 'index.rb'
and start the sever like this
ruby my_app.rb
but it never reload any changes I made in index page.
Did I miss anything here?
If you only change your templates sinatra will always rerender them if you set your environment to development:
I like the Shotgun gem. If you're using a modular Sinatra app and have a config.ru file it's easy to run.
Check the gem out here. It's fairly straight forward and no configuration needed.
You could use guard-rack. Lifted from an article at dblock.org:
Add this to your Gemfile:
Then, create a
Guardfile
at the root of your project with this content:Lastly, run Guard, like so:
bundle exec guard
, andrackup
will reload every time.gem install sinatra-reloader
You may want to set environment variable to development and conditionally load the gem.
On Windows, I am using my restart gem for this:
or, with rackup:
See here for more info, hope you find it useful.
Note: it will reload only sinatra handlers (and, maybe some sinatra server configuration commands), but not custom files, which you have to reload manually.