bundler icon indicating copy to clipboard operation
bundler copied to clipboard

Bundled gem with :path does not load Rake tasks and generators in Rails 2.3

Open ghost opened this issue 14 years ago • 2 comments

When bundling a Rails 2.3 engine as a gem located in my application's root via :path, Rails correctly determines the load paths for app/controllers, app/models, etc., but does not load any of the Rake tasks located in tasks (or if I put them in lib/tasks) and generators. Everything works fine if the plugin is located in vendor/plugins instead.

The relevant line in my Gemfile:

gem 'mygem', :path => 'mygem' # Gem is located in RAILS_ROOT/mygem as a git submodule

Also attempted this:

group :plugins do
  gem 'mygem', :path => 'mygem'
end

And explicitly requiring the gem's library:

gem 'mygem', :path => 'mygem', :require => 'mygem'

I verified this by cloning devise's 1.0 branch as a submodule in the same fashion. Generators do not show up. Also, Paperclip is bundled as a regular gem and the Rake tasks do not show up.

ghost avatar May 27 '10 15:05 ghost

Using Bundler 0.9.25 with Rails 2.3.8.

ghost avatar May 27 '10 15:05 ghost

Confirmed with Rails 2.3.11. rails/lib/rails_generator/lookup.rb#generator_full_paths seems to be the trouble.

DougPuchalski avatar May 28 '11 19:05 DougPuchalski