Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with the rubygems plugin keyword #178

Open
hlascelles opened this issue Feb 22, 2021 · 2 comments
Open

Error with the rubygems plugin keyword #178

hlascelles opened this issue Feb 22, 2021 · 2 comments

Comments

@hlascelles
Copy link

I've recently added Diffend to my project, but am seeing the following error.

Is this the "not supported" part of the Appraisal README that says: "vendoring plugins is not supported"?

❯ bundle exec appraisal update 
Found existing alias for "bundle exec". You should use: "be"
bundler: failed to load command: appraisal (bin/appraisal)
NoMethodError: undefined method `plugin' for #<Appraisal::Gemfile:0x000055b3e8bf0ff8>
 lib/ruby/gems/2.7.0/gems/appraisal-2.3.0/lib/appraisal/gemfile.rb:22:in `run'
 lib/ruby/gems/2.7.0/gems/appraisal-2.3.0/lib/appraisal/gemfile.rb:20:in `instance_eval'
 lib/ruby/gems/2.7.0/gems/appraisal-2.3.0/lib/appraisal/gemfile.rb:20:in `run'
...
 bin/appraisal:23:in `load'
 bin/appraisal:23:in `<top (required)>'

Would you say wrapping it in !ENV["APPRAISAL_INITIALIZED"] is the canonical way of working with plugins?

@nickcharlton
Copy link
Member

I've not had the opportunity to work with a plugin, but looking at this I think that's right: https://bundler.io/guides/bundler_plugins.html

You'll get a NoMethodError, as Appraisal is trying to parse the Gemfile by executing it.

I suspect wrapping it would work, yes. Give it a go and report back?

(It'd be nice to update README to link to this issue if indeed that's true!)

@pboling
Copy link
Contributor

pboling commented Nov 4, 2021

Having the same issue with diffend. I had hoped to add it to all my projects... but this will block a number of them.

jrafanie referenced this issue in jrafanie/activerecord-id_regions Feb 1, 2022
Appraisal is nice but it can be simplified.
Additionally, it doesn't currently support the bundler plugin api so
override_gem, plugin, etc., won't work.  We do this in some repositories
so unless there's a reason to stick with appraisal, it's safer
to use a solution that's simpler and more future-proof.

See: `https://github.com/thoughtbot/appraisal/issues/178`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants