Stop restarting your server after editing local gems!
In your development.rb
, add:
GemReloader.watch :my_gem
Or, if you want to watch all local gems:
GemReloader.watch_all!
That's literally it. Tiny but useful.
Important Note:
If your gems are in irregular directories (directories that aren't in your
autoload_paths
), you'll need to add those paths in yourapplication.rb
. GemReloader will automatically addvendor/gems
to the autoload_paths for you.
By the way, a gem will be picked up by ::watch_all!
if it has a :path attribute.
Add this line to your application's Gemfile:
gem 'gem_reloader'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gem_reloader
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- v0.0.2: Added "vendor/gems" to the config.autoload_paths so the user doesn't have to.