Created attachment 403442 [details] emerge-info.txt The setting is as follows: * Stable amd64 system with no ruby packages. * RUBY_TARGETS="ruby19 ruby20 ruby21" in make.conf. * I want to test a new package (ebuild) with both rails-3 and rails-4. The simplest way to get rails-3 installed is to, # emerge -v1 --autounmask-write =dev-ruby/rails-3.2.21 If I merge the changes to package.accept_keywords, then re-run the command, some rails-4.2.1 dependencies get pulled in (for ruby21 support) along with rails-3.2.21. Which is OK. Because I'll eventually install rails-4 anyway. Except, # eselect rails list Available Ruby on Rails versions: [1] rails-4.2.1 [2] rails-3.2.21 * # rails --version Rails 4.2.1 # /usr/bin/rails-3.2.21 --version Rails 4.2.1 Note: I don't even have dev-ruby/rails-4.2.1 installed! Only some of its dependencies. The same thing happens with rails-4.1 and rails-4.0 (i.e. when I mask versions 4.2 and 4.1 of the rails stuff and try again). Here's all the stuff it pulls in for rails-3.2.21 with nothing masked. [ebuild N ~] app-eselect/eselect-rails-0.21::gentoo 0 KiB [ebuild N ] net-libs/nodejs-0.10.30::gentoo USE="npm snapshot" 0 KiB [ebuild N ~] virtual/ruby-ssl-7::gentoo RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/rack-1.6.0:1.6::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/thor-0.19.1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/builder-3.0.4-r1:3::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/thread_safe-0.3.5::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/builder-3.2.2-r1:3.2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/execjs-2.5.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/minitest-5.5.1:5::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/i18n-0.7.0:0.7::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/rexical-1.0.5-r3::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/abstract-1.0.0-r3::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/mime-types-2.5:2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/polyglot-0.3.5::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ] dev-ruby/tzinfo-0.3.43::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/arel-3.0.2-r2:3.0::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/bcrypt-ruby-3.1.10::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/i18n-0.6.11:0.6::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/rack-1.4.5-r3:1.4::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/journey-1.0.4-r1:1.0::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/hike-1.2.3-r1::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ] dev-ruby/coffee-script-source-1.7.1::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/rack-ssl-1.3.4:1.3::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ] dev-ruby/ffi-1.9.6-r1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/rack-test-0.6.3:0.6::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/erubis-2.7.0-r2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/tilt-1.4.1-r2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/tzinfo-1.2.2:1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/rake-compiler-0.9.5::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/treetop-1.5.3::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/rack-cache-1.2-r1:1.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ] dev-ruby/coffee-script-2.2.0-r1::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ] virtual/ruby-ffi-2::gentoo RUBY_TARGETS="ruby19 ruby20 (-jruby)" 0 KiB [ebuild N ~] dev-ruby/activesupport-4.2.1:4.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/multi_json-1.11.0::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/uglifier-2.7.1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/mail-2.5.4:2.5::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ] dev-ruby/rb-inotify-0.9.5::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/activesupport-3.2.21:3.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/rails-deprecated_sanitizer-1.0.3::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ] dev-ruby/listen-0.7.3-r1::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/sprockets-2.2.3:2.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/activemodel-3.2.21:3.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/activeresource-3.2.21:3.2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ] dev-ruby/sass-3.2.19::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/actionpack-3.2.21:3.2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/activerecord-3.2.21:3.2::gentoo USE="-mysql -postgres -sqlite3 {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/actionmailer-3.2.21:3.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/railties-3.2.21:3.2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/hoe-3.13.1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/nokogiri-1.6.6.2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/coffee-rails-3.2.2:3.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/sass-rails-3.2.6:3.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/rails-dom-testing-1.0.6:1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/loofah-2.0.1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21 -ruby22" 0 KiB [ebuild N ~] dev-ruby/rails-html-sanitizer-1.0.2:1::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/actionview-4.2.1:4.2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/actionpack-4.2.1:4.2::gentoo USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/railties-4.2.1:4.2::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ~] dev-ruby/jquery-rails-4.0.3:4::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20 ruby21" 0 KiB [ebuild N ] dev-ruby/bundler-1.7.3::gentoo USE="{-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB [ebuild N ~] dev-ruby/rails-3.2.21:3.2::gentoo USE="asset-pipeline {-test}" RUBY_TARGETS="ruby19 ruby20" 0 KiB
The rails binstub is provided by dev-ruby/railties, which is why you are seeing this without actually having dev-ruby/rails:4.2 installed. The concept of eselect is actually broken in this case since gems assume that they will overwrite the binstub on each up or downgrade, so these can handle the versioning themselves. Other than surprise this should not cause actual problems, as far as I'm aware.
(In reply to Hans de Graaff from comment #1) > Other than surprise this should not cause > actual problems, as far as I'm aware. So... stupid question maybe.. how do I use rails-3.x after the 4.x slot of railties gets pulled in? If I run `rails new`, it creates a rails-4.x project. (Which, incidentally, depends on dev-ruby/web-console ~> 2.0 that isn't in the tree.)
(In reply to Michael Orlitzky from comment #2) > So... stupid question maybe.. how do I use rails-3.x after the 4.x slot of > railties gets pulled in? If I run `rails new`, it creates a rails-4.x > project. Do you really still want to create a new rails 3.x project at this time? I'm asking because "rails new" is the only issue that might arise from the current setup. Using the rails command from 4.x on an existing 3.x project works fine. bug 370757 should make doing "rails new" a lot easier. Right now you would probably need to use bundler or isolate or a similar tool to get things to work correctly. > (Which, incidentally, depends on dev-ruby/web-console ~> 2.0 that > isn't in the tree.) We currently have dev-ruby/web-console-2.1.1 and web-console-2.1.2 to cover that.
(In reply to Hans de Graaff from comment #3) > > Do you really still want to create a new rails 3.x project at this time? I'm > asking because "rails new" is the only issue that might arise from the > current setup. Using the rails command from 4.x on an existing 3.x project > works fine. I don't need to start a new rails-3.x project for serious development, but I do need to test things in rails-3.x (we have three rails sites, all still on 3.x). I noticed that same problem also exists with rails:4.0 and rails:4.1, which means you can't create new projects for those versions either, unless you add the newer versions of railties to package.mask. > > (Which, incidentally, depends on dev-ruby/web-console ~> 2.0 that > > isn't in the tree.) > > We currently have dev-ruby/web-console-2.1.1 and web-console-2.1.2 to cover > that. Sorry, I misremembered. It's in the tree, but it isn't pulled in when you emerge rails. So a `rake test` immediately crashes with a dependency error. If it helps, all I'm really trying to do here is test a rails plugin in an ebuild. The plugin should support all of our (Gentoo's) rails versions, but in particular the one that the user has eselected. So the test phase is doing `rails new`, then some messing around, and finally `rake test`. That doesn't work for rails-3.x, because what I really get is a rails-4.x project. And it doesn't work with rails-4.x because of the missing web-console dep (at least).
(In reply to Michael Orlitzky from comment #4) > I don't need to start a new rails-3.x project for serious development, but I > do need to test things in rails-3.x (we have three rails sites, all still on > 3.x). The current setup works fine in that case (we have a similar situation at work). > I noticed that same problem also exists with rails:4.0 and rails:4.1, which > means you can't create new projects for those versions either, unless you > add the newer versions of railties to package.mask. Yes, it is a generic issue for all ruby packages that install binstubs and are slotted. > If it helps, all I'm really trying to do here is test a rails plugin in an > ebuild. The plugin should support all of our (Gentoo's) rails versions, but > in particular the one that the user has eselected. So the test phase is > doing `rails new`, then some messing around, and finally `rake test`. > > That doesn't work for rails-3.x, because what I really get is a rails-4.x > project. Ok, that use case is clear. But even with a working eselect that would be difficult. Doesn't seem nice to switch rails versions around with eselect in the ebuild. What about this: ruby -e 'gem "rails", "~>3.2"; require "rails/cli"' new . > And it doesn't work with rails-4.x because of the missing > web-console dep (at least). It looks like we are missing more than just web-console if you take the default Gemfile as a guidance (e.g. turbolinks, byebug). Not all of them are in the tree and not everyone may need or want them installed. Not sure how to handle this in the best way.
(In reply to Hans de Graaff from comment #5) > > Ok, that use case is clear. But even with a working eselect that would be > difficult. Doesn't seem nice to switch rails versions around with eselect in > the ebuild. Oh, no, I wasn't planning on using eselect in the ebuild. In the ebuild, I would simply use `rails`. Then, I could use eselect to change the rails version, and re-emerge the package to test with different versions. > What about this: > > ruby -e 'gem "rails", "~>3.2"; require "rails/cli"' new . Yes, this works! Thank you. I can't change it outside of the ebuild, but it's at least enough for me to test things myself and make sure they work. > It looks like we are missing more than just web-console if you take the > default Gemfile as a guidance (e.g. turbolinks, byebug). Not all of them are > in the tree and not everyone may need or want them installed. Not sure how > to handle this in the best way. You can turn off turbolinks with `rails new ... --skip-turbolinks`, but I haven't found a way to turn off web-console without e.g. sed. I'm starting to think it might be easier to just clobber the default Gemfile with my own.
I'm going to mark this fixed. It seems hard to prevent this more generally, and we're off rails-3.x now. This works around the specific problem I had in my ebuild: ruby -e 'gem "rails", "~>3.2"; require "rails/cli"' new So, thanks!