Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 268767 - app-admin/eselect-ruby: patch to support binaries installed by "gem" rather than "emerge"
Summary: app-admin/eselect-ruby: patch to support binaries installed by "gem" rather t...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-05 22:44 UTC by Sven Schwyn (svoop)
Modified: 2009-05-06 06:52 UTC (History)
0 users

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


Attachments
shebang patch for ruby.eselect (ruby-eselect.patch,582 bytes, patch)
2009-05-05 22:47 UTC, Sven Schwyn (svoop)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Schwyn (svoop) 2009-05-05 22:44:14 UTC
It's a good idea to install Ruby gems via "emerge", however, it's reality that many prefer to do it directly with "gem". Gems may contain Ruby scripts that go to /usr/bin - and that's when it can get messy.

Let's assume you eselect ruby18 and install the rake gem. This gem installs the rake script which gets the shebang /usr/bin/ruby18. Now eselect ruby19 and install the same gem there. The rake script will be overwritten with shebang /usr/bin/ruby19.

The attached patch is a workaround for this. When switching to another Ruby profile, the shebang of all scripts generated by RubyGems is altered from the versioned "rubyNN" to "ruby" (the symlink).

Reproducible: Always

Steps to Reproduce:




I'm aware that such a patch is not an ideal solution. I'm also asking upstream whether there's a chance to have RubyGems NOT expand /usr/bin/ruby if it is a symlink like ruby -> ruby18. I'll add a comment once I have an answer.
Comment 1 Sven Schwyn (svoop) 2009-05-05 22:47:16 UTC
Created attachment 190449 [details, diff]
shebang patch for ruby.eselect
Comment 2 Sven Schwyn (svoop) 2009-05-06 06:52:57 UTC
I got some interesting input from upstream and can write a patch now that honors both Gentoo's as well as Ruby's paradigms. So let me close this bug, I'll submit the patch as soon as it's written and tested.