Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 346541 - dev-ruby/rake-0.8.7-r6: running rake fails with RUBY_TARGETS="-ruby18"
Summary: dev-ruby/rake-0.8.7-r6: running rake fails with RUBY_TARGETS="-ruby18"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-23 16:42 UTC by Kai Krakow
Modified: 2010-11-30 20:21 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 Kai Krakow 2010-11-23 16:42:42 UTC
I'm trying to install a system with only RUBY_TARGETS="ree18". Thus, rake was installed with gems only in the rubyee path. Trying to invoke rake now yields the following error:

vweb004 ~ # rake
/usr/bin/rake:8:in `load': no such file to load -- /usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/bin/rake (LoadError)
        from /usr/bin/rake:8

This, in consequence, makes other ebuilds fail as they may require a working rake (e.g. passenger).

Output of "eselect ruby list":

Available Ruby profiles:
  [1]   rubyee18 (with Rubygems) *


Reproducible: Always

Steps to Reproduce:
1. set RUBY_TARGETS in make.conf to "ree18" only
2. emerge "rake"
3. invoke "rake" on the command line
Comment 1 Hans de Graaff gentoo-dev Security 2010-11-24 12:31:11 UTC
We currently don't support a setup with -ruby18.

What does 'ls -l /usr/bin/ruby' say?
Comment 2 Kai Krakow 2010-11-24 16:25:43 UTC
(In reply to comment #1)
> We currently don't support a setup with -ruby18.
> 
> What does 'ls -l /usr/bin/ruby' say?

It says this:

# ls -l /usr/bin/ruby
lrwxrwxrwx 1 root root 8 Nov 23 16:33 /usr/bin/ruby -> rubyee18

which means, ruby SHOULD BE looking in /usr/lib64/rubyee/gems/, and that's where the rake stuff is installed:

# ls -ld /usr/lib64/rubyee/gems/1.8/gems/rake*
drwxr-xr-x 4 root root 26 Nov 23 15:09 /usr/lib64/rubyee/gems/1.8/gems/rake-0.8.7

But when invoking the rake command, it get's the wrong gem path:


vweb004 ~ # cat /usr/bin/rake 
#!/usr/bin/rubyee18
# This is a simplified version of the RubyGems wrapper
#
# Generated by ruby-fakegem.eclass : 1.24 $

require 'rubygems'

puts Gem::default_path[-1] #<-- added for debugging
load Gem::default_path[-1] + "/gems/rake-0.8.7/bin/rake"

Output is now:

# rake
/usr/lib64/ruby/gems/1.8
/usr/bin/rake:9:in `load': no such file to load -- /usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/bin/rake (LoadError)
        from /usr/bin/rake:9


"Gem::default_path" simply returns the wrong path...
Comment 3 Kai Krakow 2010-11-24 16:28:03 UTC
BTW: This all doesn't fit together. Why does the rake command shebang line reference rubyee18 statically, and not the ruby symlink which is maintained by "eselect ruby"?
Comment 4 Kai Krakow 2010-11-24 16:33:53 UTC
Okay, I upgraded to rubygems-1.3.7-r4 which seems to fix the search path. But the shebang line is still static and not symlinked.
Comment 5 Hans de Graaff gentoo-dev Security 2010-11-29 19:57:02 UTC
The eclass documentation says:

                # Try to find out whether the package is going to install for
                # one or multiple implementations; if we're installing for a
                # *single* implementation, no need to use “/usr/bin/env ruby”
                # in the shebang, and we can actually avoid errors when
                # calling the script by default (see for instance the
                # JRuby-specific commands).
 
So that explains why you have /usr/bin/rubyee18 linked directly.

@Diego: not sure if this is a good, idea, since this won't handle people adding additional implementations later and then switching.

@Kai: as far as I can tell your real bug was the broken search path which is fixed with the latest version of rubygems, and we can close this bug, right?
Comment 6 Kai Krakow 2010-11-29 20:41:34 UTC
(In reply to comment #5)
> So that explains why you have /usr/bin/rubyee18 linked directly.

I see. But the point is, that "rake" is not targetted to a _SINGLE_ implementation: The ebuild supports multiple ruby targets and even installs its gems there. I even don't see any such restriction in the ebuild.

> @Diego: not sure if this is a good, idea, since this won't handle people adding
> additional implementations later and then switching.

Who said what? Seeing no comment...

> @Kai: as far as I can tell your real bug was the broken search path which is
> fixed with the latest version of rubygems, and we can close this bug, right?

What if I installed "rake" with more than one ruby target? Maybe it can be closed, not sure currently. I have never tried installing rake with more than one target set.
Comment 7 Hans de Graaff gentoo-dev Security 2010-11-30 19:39:50 UTC
(In reply to comment #6)

> I see. But the point is, that "rake" is not targetted to a _SINGLE_
> implementation: 

It is on your system since you only have one RUBY_TARGET defined.

> What if I installed "rake" with more than one ruby target? Maybe it can be
> closed, not sure currently. I have never tried installing rake with more than
> one target set.

The problem you started this bug with is solved, right?

Comment 8 Kai Krakow 2010-11-30 20:21:27 UTC
> (In reply to comment #6)
> > I see. But the point is, that "rake" is not targetted to a _SINGLE_
> > implementation: 
> It is on your system since you only have one RUBY_TARGET defined.

Okay - that explains.

> The problem you started this bug with is solved, right?

Probably yes. Resolving as fixed by upgrading rubygems.