The problem was not with the gem, but with the way it was included in the app.
In the Gemfile
, this works and includes the rake task:
gem 'gem_fresh'
This works but doesn't include the rake task:
group :development do
gem 'gem_fresh'
end
This seems to be due to how Bundler requires gems in Rails apps. From the documentation:
By default, a Rails generated app calls Bundler.require(:default, Rails.env)
in your application.rb, which links the groups in your Gemfile to the Rails environment.
If for some reason that Rails.env
argument wasn't evaluating to include the :development
group, which seems to be the case when I call rake -T
, the gem wouldn't be Bundler.require
-d, and the rake tasks wouldn't be loaded.
The fact that it isn't including the :development
group seems to be an odd Bundler "gotcha", but at least now I know that moving it to the default group solves the issue and it's not a problem with the gem.