appraisal icon indicating copy to clipboard operation
appraisal copied to clipboard

Error with the rubygems `plugin` keyword

Open hlascelles opened this issue 3 years ago • 2 comments

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?

hlascelles avatar Feb 22 '21 10:02 hlascelles

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!)

nickcharlton avatar Jun 25 '21 16:06 nickcharlton

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

pboling avatar Nov 04 '21 11:11 pboling