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

Consider adding ./VERSION file to gemspec in order to support local unpacking. #1308

Closed
bwad opened this issue Jun 8, 2017 · 4 comments
Closed

Comments

@bwad
Copy link

bwad commented Jun 8, 2017

Ruby Version: 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]

Procedure to reproduce:

  1. Unpack gem locally:

     gem unpack sinatra
    
  2. Create Gemfile:

     source "https://rubygems.org"
     gem 'sinatra', :path => './sinatra-2.0.0'
    
  3. Run bundler:

     bundle install
    

    Output:

     [!] There was an error while loading `sinatra.gemspec`: No such file or 
          directory @ rb_sysopen - <redacted>/sinatra-2.0.0/VERSION. Bundler 
          cannot continue.
    
     #  from <redacted>/sinatra-2.0.0/sinatra.gemspec:1
    #  -------------------------------------------
    >  version = File.read(File.expand_path("../VERSION", __FILE__)).strip
    #  
    #  -------------------------------------------
    

Local Fix:

Create local ./sinatra-2.0.0/VERSION file with following contents:

  2.0.0
@b264
Copy link

b264 commented Jun 8, 2017

Do you know why this one doesn't work?

@bwad
Copy link
Author

bwad commented Jun 9, 2017

I expect it would.

The issue is that the gemspec has a dependency on the existence of the '../VERSION' file and running bundle install on the locally unpacked gem trips over the unsatisfied dependency.

I could have copied the one from the project to fix my problem, but the issue is that it would be easier if it came with the unpacked gem in the first place. I expect that adding "VERSION" to the s.files section of the gemspec would fix the problem, but I don't really have the experience to say whether it's the best solution or that the issue even warrants the effort.

@zzak
Copy link
Member

zzak commented Jul 4, 2017

Ahh sorry, this must have been an oversight.

Could you send a patch? 🙇

olleolleolle added a commit to olleolleolle/sinatra that referenced this issue Aug 18, 2017
@olleolleolle
Copy link
Member

@zzak I made a patch.

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

4 participants