thekompanee/fuubar

Gem fails to bundle, unitilized constant in .gemspec

donquxiote opened this issue · 6 comments

Current Behavior

latest version of fuubar throws an uninitialized constant error when either running bundle install within the gem directory or when included in a gemfile.

[!] There was an error parsing `Gemfile`:
[!] There was an error while loading `fuubar.gemspec`: uninitialized constant Fuubar. Bundler cannot continue.

 #  from /Users/james.buckley/dev/test/fuubar/fuubar.gemspec:25
 #  -------------------------------------------
 #      'changelog_uri'     => 'https://github.com/thekompanee/fuubar/blob/master/CHANGELOG.md',
 >      'documentation_uri' => "https://github.com/thekompanee/fuubar/tree/releases/v#{Fuubar::VERSION}",
 #      'homepage_uri'      => 'https://github.com/thekompanee/fuubar',
 #  -------------------------------------------
. Bundler cannot continue.

 #  from /Users/james.buckley/dev/test/fuubar/Gemfile:10
 #  -------------------------------------------
 #  # Specify your gem's dependencies in fuubar.gemspec
 >  gemspec
 #  -------------------------------------------

If I remove the call to Fuubar::Version I get another error;

The gemspec at /Users/james.buckley/dev/test/fuubar/fuubar.gemspec is not valid. Please fix this gemspec.
The validation error was 'metadata values must be a String'

Which appears to come from this line: fuubar.gemspec:22:

'allowed_push_host' => nil,

Steps to Reproduce

  1. check out gem
  2. run bundle install from within that directory

OR

  1. add gem to your gemfile
  2. run bundle install for your project

Expected Behavior

I'd expect that the gem would build correctly.

Environment

  • Device: Macbook Pro

  • Bundler: tried with Bundler version 1.16.2, and 1.17.2

  • OS:

    • Windows
    • macOS
    • iOS
    • Android
    • Linux
    • Other
  • OS Version: 10.14.5

@donquxiote I find it odd that you're getting this error and no one else is. I feel like this is something that would have been complained about (and loudly) immediately after releasing.

that's fair! I'll try it on a separate machine later this week, it could be an environmental thing. I wanted to document it as I found it though. I'm guessing you have metrics showing folks are using the latest version? I had imagined a possibility (incredibly slim though,) that the last version was locked in by Gemfile.lock files so no one got the update

@donquxiote releasing a new version now and yanking 2.4.0. Just in case anyone else is running into this. Better safe than sorry. I'll reopen if 2.4.1 doesn't fix it for ya.

Sorry about the unnecessary issue. It looks like when I was trying to merge in the latest to my fork I overwrote or lost some changes on the gemspec file. That's how I got those weird lines that didn't exist in the master branch. My mistake was assuming that my merge had gone cleanly and the master branches were the same between forks without checking. Thanks for the quick replies though!

@donquxiote ugh. That sucks. I yanked the 2.4.0 version of the gem and made a lot of people very unhappy. I won't be doing that again in the future. :/

This issue has been closed automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.