Live Reload for your Rails app. The easiest way to increase your productivity.
MIT License
This is the simplest and probably the most robust way to add live reloading to your Rails app.
Just add the gem and thats it, now you have a live reloading. You don't need anything other than this gem for live reloading to work.
Works with:
The page is reloaded fully with window.location.reload()
to make sure that every chage will be displayed.
Just add this gem to the Gemfile (in development environment) and start the rails s
.
Add this line to your application's Gemfile:
group :development do
gem "rails_live_reload"
end
And then execute:
$ bundle
run command:
rails generate rails_live_reload:install
The generator will install an initializer which describes RailsLiveReload
configuration options.
There are 3 main parts:
listen
gem)The default configuration assumes that you either use asset pipeline, or that your assets compile quickly (on most applications asset compilation takes around 50-200ms), so it watches for changes in app/assets
and app/javascript
folders, this will not be a problem for 99% of users, but in case your asset compilation takes couple of seconds, this might not work propperly, in that case we would recommend you to add configuration to watch output folder.
You are welcome to contribute. See list of TODO's
below.
Too many open files - pipe
- increase limits by ulimit -n 10000
The gem is available as open source under the terms of the MIT License.