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:
Created attachment 264019 [details] Patch against current ruby.ebuild
> 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.
And - just hours later - rubygems-1.6.0 is out.