Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 356669 - app-eselect/eselect-ruby: patch to improve cooperation with gem command
Summary: app-eselect/eselect-ruby: patch to improve cooperation with gem command
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-27 09:29 UTC by Sven Schwyn (svoop)
Modified: 2022-10-10 19:17 UTC (History)
0 users

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


Attachments
Patch against current ruby.ebuild (ruby.eselect.patch,1.47 KB, text/plain)
2011-02-27 09:30 UTC, Sven Schwyn (svoop)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Schwyn (svoop) 2011-02-27 09:29:38 UTC
The locations Gentoo uses for Ruby gems have changed a while ago and now allow the peaceful co-existance of Portage and Rubygems.

* /usr/local/lib/ruby for gems installed via "gem install"
* /usr/lib/ruby for gems installed via "emerge"

When multiple Rubies are installed and managed by use of eselect-ruby, the fakegem manages the executables supplied by gems installed via "emerge". Unfortunately, no such mechanism exists for the gems installed via "gem install" yet. The attached patch fixes this.

It adds "eselect ruby rebuild" which makes sure all Ruby bin wrappers (in /usr/local/ruby) are properly symlinked for the currently active Ruby version, e.g. "rake19 -> rake" even if it has been installed with "gem install rake" rather than "emerge rake". This rebuild is implicitly called after "eselect ruby set ..."

For this to work, "gem --format-executable" must be enforced. This argument makes sure all Ruby bin wrappers are postfixed with the Ruby version, e.g. "rake19" rather than just "rake". To enforce this system wide, the file /etc/gemrc must contain "gem: --format-executable".

In fact, gemrc ist a YAML file, so it should look as follows:

---
gem: --format-executable

Two more things:

I'm working on a patch for Rubygems to have additional gemrc files and pass them in by setting the GEMRC environment variable. It could be used to pass --format-executable in a gemrc supplied by the Rubygems ebuild while leaving /etc/gemrc untouched. Then again, this could be a little too much magic.
(http://rubyforge.org/tracker/index.php?func=detail&aid=28943&group_id=126&atid=578)

At this point "gem uninstall" does not (yet) honor the --format-executable argument and thus won't remove the actual versioned executable but the symlink.
(http://rubyforge.org/tracker/index.php?func=detail&aid=28993&group_id=126&atid=575)


Reproducible: Always

Steps to Reproduce:
Comment 1 Sven Schwyn (svoop) 2011-02-27 09:30:11 UTC
Created attachment 264019 [details]
Patch against current ruby.ebuild
Comment 2 Sven Schwyn (svoop) 2011-03-02 07:47:50 UTC
> At this point "gem uninstall" does not (yet) honor the --format-executable
> argument and thus won't remove the actual versioned executable but the symlink.
> (http://rubyforge.org/tracker/index.php?func=detail&aid=28993&group_id=126&atid=575)

This has been fixed upstream and will be part of the 1.6.0 rollout.
Comment 3 Sven Schwyn (svoop) 2011-03-02 13:41:16 UTC
And - just hours later - rubygems-1.6.0 is out.