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

Breaks rubygems on ruby 1.9.3 #158

Closed
next-mad-hatter opened this issue Jan 13, 2015 · 6 comments
Closed

Breaks rubygems on ruby 1.9.3 #158

next-mad-hatter opened this issue Jan 13, 2015 · 6 comments

Comments

@next-mad-hatter
Copy link

On ruby 1.9.3, installing v.3 results in non-updateable gems set, since v.4 still advertises itself as an update to v.3, but fails at runtime.

If the logic is not implementable via standard rubygems mechanisms, maybe it'd be better to make v.4 a distinct gem?

@leejarvis
Copy link
Owner

You need to tell Rubygems that you want version ~> 3.0 of Slop in your project. That way you won't get the incompatible version.

@next-mad-hatter
Copy link
Author

If I am not mistaken, there is no way to do that for a vanilla rubygems install -- now is there?

@leejarvis
Copy link
Owner

If you're building a gem, you can specify the version in your gemspec, if you're just wanting to use a specific version in a script you're running, you can do this:

gem 'slop', '~> 3.0'
require 'slop'

p Slop::VERSION

@next-mad-hatter
Copy link
Author

That's not what I mean (I think the above snippet doesn't even touch the gems) -- the point is that if I do, say,

    $ gem install ruby-lint pry

(where both install Slop as a dependency), every gem update after that will fail (as rubygems does not do anything akin to apt-style-pinning -- again, if I am not mistaken), rendering the installed gem set non-updatable.

@leejarvis
Copy link
Owner

I still don't follow. Using those steps you suggested do not cause any failures or errors for me. Both ruby-lint and pry use version 3 of Slop. Running gem update on 1.9 shouldn't update Slop to version 4 because we've specified that it's non-compatible. if it does, that's not Slops fault. It's common to upgrade gems and specify a minimum Ruby version

@next-mad-hatter
Copy link
Author

that's not Slops fault

It really does seem now a rubygems shortcoming [1] -- I had not encountered this before. Anyway, thanks for pointing me to the spec index direction.

Running gem update on 1.9 shouldn't update Slop to version 4

Ah but it will try -- and fail :)

# gem environment | grep VERSION
  - RUBYGEMS VERSION: 2.4.5
  - RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-linux]
# gem install slop
ERROR:  Error installing slop:
        slop requires Ruby version >= 2.0.0.

Closing issue now since this is how rubygems operates.

[1] rubygems/rubygems#798

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

2 participants