Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494276 - >=www-apache/passenger-4 and <dev-ruby/rails-4 conflict when RUBY_TARGETS="ruby19 ruby20"
Summary: >=www-apache/passenger-4 and <dev-ruby/rails-4 conflict when RUBY_TARGETS="ru...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-14 22:07 UTC by Michael Orlitzky
Modified: 2013-12-16 20:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2013-12-14 22:07:47 UTC
Passenger-4.x pulls in >=dev-ruby/rack-1.5.2-r1 because of ruby20, and
actionpack-3.2.16 pulls in >=dev-ruby/rack-1.4.5:1.4 unconditionally. The two packages happily coexist, but when Passenger attempts to launch, it explodes:

  Unable to activate actionpack-3.2.16, because rack-1.5.2 conflicts with rack (~> 1.4.5) (Gem::LoadError)
    /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1990:in `raise_if_conflicts'
    /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1163:in `activate'
  ...

Quick fix, if possible:

  www-apache/passenger -ruby_targets_ruby20

in package.use.
Comment 1 Hans de Graaff gentoo-dev Security 2013-12-15 08:59:44 UTC
This could be fixed for now by adding ruby20 support to rack:1.4, but the test suite fails in this case so we can't do that.

You should really fix this in your application anyway since things will break once something actually needs rack:1.5. Just require the correct version of rack in your Isolate or Gemfile or however you manage dependencies.
Comment 2 Michael Orlitzky gentoo-dev 2013-12-15 16:50:22 UTC
I'm using portage to manage dependencies =)

The error is ultimately coming from rubygems, and it looks like other people have had similar issues outside of Gentoo. If I had to guess, probably some other part of Rails does a require 'rack' to load up rack-1.5.2 (the newest available), then when it gets to actionpack, 1.4.5 can't be loaded.

I was able to fix this nicely by setting RUBY_TARGETS="ruby19" and package.masking >=dev-lang/ruby-2. Thanks for taking a look.
Comment 3 Hans de Graaff gentoo-dev Security 2013-12-16 20:06:15 UTC
(In reply to Michael Orlitzky from comment #2)
> I'm using portage to manage dependencies =)
> 
> The error is ultimately coming from rubygems, and it looks like other people
> have had similar issues outside of Gentoo. If I had to guess, probably some
> other part of Rails does a require 'rack' to load up rack-1.5.2 (the newest
> available), then when it gets to actionpack, 1.4.5 can't be loaded.

Yes, this is what happens, but you are fixing it by not installing rack 1.5 at all. That is only a tenable strategy as long as nothing else requires it. You can manage the installation of dependencies with portage, but your application still needs to decide which versions to require. Even if you are just doing 'require' you still indicate that any version will do. Somehow you are loading a specific version of rails, so that's also the place to add a requirement for "rack ~> 1.4.0"