After much headaches with trying to install stuff under ruby, i discovered the following: rubygems-0.8.11-r1 when emerged sets the RUBYOPT variable in /etc/env.d/10rubygems to be "-rubygems" which is a misstype of "-rrubygems" which results in ruby executing require ubygems .. which causes packages to break. also, for those with multiple installations of ruby (ie: ruby19 and ruby18) it only installs rubygems for the currently set "default" ruby as defined with ruby-config the problem with this is, all other ruby packages detect multiple installations of ruby and attempt to install for both, but as installation requires gem, it only installs for the one that was set when rubygems was installed, ie: if you installed rubygems to work with ruby19, it will fail when it tries to build for ruby18, and if you set it to ruby18, it will fail when it tries to build for ruby19. This effectively means if you have two installations of ruby, suddenly you cant install any more extensions, which is a really big problem... also, the combination of above env setting, and rubygem only installing for one ruby version at a time, results in a 3rd little problem, as rubygems emerging REQUIRES RUBYGEMS TO ALREADY BE INSTALLED ( ie: if you dont have it installed already in either r18 or 19, your screwed ) and it also means, if you by some fluke chance happen to get rubygems to install, you wont be doing it again, due to the env.d change preventing any emerging of something ruby. The only way i managed to test this, is by copying my already existing rubygems stuff from the site_ruby/1.9 folder to the site_ruby/1.8 and manually fixed the env.d setting to have the extra 'r' then emerged rubygems under ruby18 (ruby-config ruby18) , which worked, but now all the other packages/ruby libraries succeed in the ruby18 build phase, but fail in the ruby19 build phase. I have to say, this happens to be the most amazing mess up ive ever witnessed... Reproducible: Always Steps to Reproduce: 1. emerge rubygems .. success... 2. emerge rubygems .. ERROR : ubygems not found 3. emerge everything else : ubygems not found -- and when env.d is manually fixed (if you installed rubygems under ruby18) 3. emerge everything else : * Installing for ruby18 /bin/install -c -m 0755 mysql.so /var/tmp/portage/mysql-ruby-2.7/image//usr/lib/ruby/site_ruby/1.8/i686-linux * Using ruby19 * Unpacking for ruby19 >>> Unpacking mysql-ruby-2.7.tar.gz to /var/tmp/portage/mysql-ruby-2.7/work * Building for ruby19 /usr/bin/ruby19: no such file to load -- rubygems (LoadError)
I will look into the dual install issue, but on my system at least there is a "ubygems.rb" file which is a hack so that you can get away with doing "-rubygems", which is prettier than "-rrubygems".
I don't see anyway around this now, so I've updated rubygems to 0.8.11-r2 which removes this RUBYOPT variable. Unfortunately, rubygems doesn't install right now againt Ruby 1.9 (broken calls to .send in various objects), so we can't install rubygems against 1.9. I've also updated the ebuild to know to only install against 1.8. Thanks for finding the error. Sorry about the problems it caused.
Should be fixed in latest Rubygems.