I added a hack to rubygems-0.8.11-r1 which added the RUBYOPT=”-rubygems” environment variable to a user’s profile. The reason for this is that when installing packages via gem (which more and more of our packages do), a normal Ruby ‘require’ doesn’t find it, unless you’ve loaded rubygems first. This hack helped remedy that.
Except it broke for people running Ruby 1.9, because rubygems wasn’t explicitly installed for them. And we can’t make it install for them, because it doesn’t install cleanly (at least for now).
So, instead I’ve tried out a new approach. I modified dev-ruby/ruby-config (to version 0.3.2) to allow for more characters in a configurable Ruby version, and added a rubygems-0.8.11-r3 which installs a /usr/bin/ruby18_with_gems, that does this:
RUBYOPT=”-rubygems” /usr/bin/ruby18 “$@”
After installing rubygems it prompts you to run ruby-config and set your new Ruby version to “ruby18_with_gems”. Doing so will automatically get rubygems loaded and you don’t have to worry about it when doing a ‘require’.
As always, feedback via bugs.gentoo.org is appreciated.