Skip to content

wrong link to journey gem in actionpack.gemspec? ('~> 1.0.0.rc1') #4317

Closed
german opened this Issue Jan 5, 2012 · 26 comments

8 participants

@german
german commented Jan 5, 2012

When installing new rails 3.2.0.rc2 an error occured:

➜  df git:(master) ✗ gem i rails --pre --no-ri --no-rdoc
Fetching: activesupport-3.2.0.rc2.gem (100%)
Fetching: activemodel-3.2.0.rc2.gem (100%)
Fetching: rack-1.4.0.gem (100%)
Fetching: journey-1.0.0.rc4.gem (100%)
Fetching: actionpack-3.2.0.rc2.gem (100%)
ERROR:  Error installing rails:
    actionpack requires journey (~> 1.0.0.rc1)
➜  df git:(master) ✗ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
➜  df git:(master) ✗ gem -v
1.8.6

The same for 1.9.3-p0 and rubygems 1.8.13. It's relevant not only for me but also for 'hipertracker', please see comment #7 to http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released

I think that it might be because of this line in https://github.com/rails/rails/blob/master/actionpack/actionpack.gemspec :

s.add_dependency('journey',       '~> 1.0.0.rc1')

What do you think? Maybe it should be something like:

s.add_dependency('journey',       '~> 1.0.0.rc')

// cc @tenderlove

Thanks!

@tenderlove
Ruby on Rails member

Can you paste the output of gem env here? I'm wondering if this is a rubygems bug.

@dewski
dewski commented Jan 5, 2012

I am getting this as well. I have supplied the commands and the gem env:

dewski ~/work (master) 
$ gem install rails --pre
Fetching: activesupport-3.2.0.rc2.gem (100%)
Fetching: activemodel-3.2.0.rc2.gem (100%)
Fetching: actionpack-3.2.0.rc2.gem (100%)
ERROR:  Error installing rails:
    actionpack requires journey (~> 1.0.0.rc1)
dewski ~/work (master) 
$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
dewski ~/work (master) 
$ gem -v
1.8.10
dewski ~/work (master) 
$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.2.0]
  - INSTALLATION DIRECTORY: /Users/dewski/.rvm/gems/ruby-1.9.2-p290
  - RUBY EXECUTABLE: /Users/dewski/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/dewski/.rvm/gems/ruby-1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/dewski/.rvm/gems/ruby-1.9.2-p290
     - /Users/dewski/.rvm/gems/ruby-1.9.2-p290@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/

After installing journey manually it works:

dewski ~/work (master) 
$ gem install journey -v 1.0.0.rc1
Fetching: journey-1.0.0.rc1.gem (100%)
Successfully installed journey-1.0.0.rc1
1 gem installed
dewski ~/work (master) 
$ gem install rails --pre
Fetching: activerecord-3.2.0.rc2.gem (100%)
Fetching: activeresource-3.2.0.rc2.gem (100%)
Fetching: actionmailer-3.2.0.rc2.gem (100%)
Fetching: railties-3.2.0.rc2.gem (100%)
Fetching: rails-3.2.0.rc2.gem (100%)
Successfully installed actionpack-3.2.0.rc2
Successfully installed activerecord-3.2.0.rc2
Successfully installed activeresource-3.2.0.rc2
Successfully installed actionmailer-3.2.0.rc2
Successfully installed railties-3.2.0.rc2
Successfully installed rails-3.2.0.rc2
6 gems installed
@tenderlove
Ruby on Rails member

Excellent, thank you!

@drbrain do you know why this would happen?

@german
german commented Jan 5, 2012

my gem env output (ruby 1.9.3):

➜  ruby  gem i rails --pre --no-ri --no-rdoc
ERROR:  Error installing rails:
    actionpack requires journey (~> 1.0.0.rc1)
➜  ruby  gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.13
  - RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/dsamoilov/.rvm/gems/ruby-1.9.3-p0
  - RUBY EXECUTABLE: /home/dsamoilov/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
  - EXECUTABLE DIRECTORY: /home/dsamoilov/.rvm/gems/ruby-1.9.3-p0/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/dsamoilov/.rvm/gems/ruby-1.9.3-p0
     - /home/dsamoilov/.rvm/gems/ruby-1.9.3-p0@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
@drbrain
drbrain commented Jan 5, 2012

1.0.0.rc1 (and all pre-release versions) fall between 1.0.0.0… and 0.999… (whichever part comes before the prerelease part, "rc1"). This allows the final version to supersede the prerelease. The only versions allowed by a ~> 1.0.0.rc1 dependency are 1.0.0.rc1 through 1.0.0.zzzz…, not 1.0.0.rc1 through 1.0.9999… and not 1.0.0.rc1 through 2.

You probably want a final dependency of ~> 1.0 not ~> 1.0.0 if journey follows the versioning policy described by ri Gem::Version since this allows for compatible feature upgrades.

If you wish to depend upon a prerelease version (which you should not as a prerelease may contain incompatible behavior with the final release, bugs, or both) you need to build a dependency equivalent to ~> by hand:

spec.add_runtime_dependency 'journey', '< 1.1', '>= 1.0.0.rc1'

But you probably actually want:

spec.add_runtime_dependency 'journey', '< 2', '>= 1.0.0.rc1'

@tenderlove
Ruby on Rails member

The only versions allowed by a ~> 1.0.0.rc1 dependency are 1.0.0.rc1 through 1.0.0.zzzz…

@drbrain doesn't that mean a version of 1.0.0.rc4 would satisfy a ~> 1.0.0.rc1 dependency?

@tenderlove
Ruby on Rails member

Something doesn't add up:

irb(main):001:0> req = Gem::Requirement.new "~> 1.0.0.rc1"
=> ~> 1.0.0.rc1
irb(main):002:0> rc4 = Gem::Version.new "1.0.0.rc4"
=> #<Gem::Version "1.0.0.rc4">
irb(main):003:0> req.satisfied_by? rc4
=> true
irb(main):004:0> v1 = Gem::Version.new "1.0.0"
=> #<Gem::Version "1.0.0">
irb(main):005:0> req.satisfied_by? v1
=> true
irb(main):006:0>
@evanphx
evanphx commented Jan 5, 2012

Weirdly, i'm not able to reproduce this. What gems do you already have installed (ie, the output of 'gem list')

@spastorino
Ruby on Rails member

@evanphx do you have journey 1.0.0.rc1 on your system? Remove it

@evanphx
evanphx commented Jan 5, 2012

@spastorino Nope, don't have it installed.

@drbrain
drbrain commented Jan 5, 2012

@tenderlove is right, I did not read close enough.

@spastorino
Ruby on Rails member

@evanphx I'm using MRI 1.9.3p0 and Rubygems 1.8.13, what are you using?

@evanphx
evanphx commented Jan 5, 2012

Rubygems 1.8.13 on 1.8.7 is what I tested it on.

@spastorino
Ruby on Rails member

@evanphx no idea so, fails for me in Rubygems 1.8.13 on 1.8.7 too

@evanphx
evanphx commented Jan 5, 2012

Could you gist what the output of 'gem list' is?

@evanphx
evanphx commented Jan 5, 2012

It appears the issue is fixed on rubygems master (which I was using). I'm figuring out what fixed it so we can get out a new 1.8 release.

@spastorino
Ruby on Rails member

@evanphx cool

@evanphx
evanphx commented Jan 5, 2012

This was a bug in rubygems and i've released rubygems 1.8.14 that fixes the problem.

@samdalton

For a fresh install of rails 3.2.0.rc2 I can also confirm that updating rubygems to 1.8.14 fixes the problem.

@evanphx
evanphx commented Jan 5, 2012

@samdalton Thanks for the confirmation!

@tenderlove
Ruby on Rails member

Great! Thanks @evanphx! I'm closing this as it's fixed in rubygems.

@tenderlove tenderlove closed this Jan 5, 2012
@spastorino
Ruby on Rails member

@evanphx just out of curiosity can you point me to the commit that fixes the issue?. Thanks!

@evanphx
@petervandenabeele

Using rvm latest and head still had this issue (rubygems 1.8.10),
so I asked to upgrade the rubygems version to 1.8.14 in rvm.

rvm/rvm#702

@petervandenabeele

The issue was fixed in rvm master and backported to stable
rvm get stable to get the newer version of rubygems by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.