Skip to content

Loading…

Full Rails plugin (Engine with dummy app) doesn't load Railties from gems in the spec #8229

Closed
rehevkor5 opened this Issue · 2 comments

3 participants

@rehevkor5

Even if you add a railtie gem as a development dependency in the gemspec of a Rails plugin with "full" specified, it doesn't get set up properly in the dummy app that is used for things like rake.

For example, if you add rspec-rails, the spec tasks don't show inrake -T.

Fortunately, I believe the appropriate fix is easy: change line 15 of lib/rails/generators/rails/plugin_new/templates/rails/application.rb from:

Bundler.require

to:

Bundler.require(*Rails.groups)

Agree/disagree?

@senny
Ruby on Rails member

I confirmed the issue. I'll create a PR to fix it and start a discussion whether there is a reason to just do a Bundler.require

@rafaelfranca rafaelfranca pushed a commit that closed this issue
@senny senny require bundler groups to include rake-tasks in engines
If you generate a full engine, this will include rake tasks from
your gem under the `app` namespace. For example if you have a dependency
on `rspec-rails` in your engine's `gemspec`. You will get the task `app:spec`

Closes #8229
a1fd9cd
@senny senny added a commit to senny/rails that referenced this issue
@senny senny backport #8262, require bundler groups to include rake-tasks in engines
If you generate a full engine, this will include rake tasks from
your gem under the `app` namespace. For example if you have a dependency
on `rspec-rails` in your engine's `gemspec`. You will get the task `app:spec`

Closes #8229

Conflicts:

	railties/CHANGELOG.md
da6951a
@rehevkor5

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.