Ruby enterprise edition (REE) on Gentoo failed and some performance experience.

Today I got the chance to give Ruby Enterprise Edition a try. We are currently working with a really fun new environment and you do not get better opportunities to try new stuff as when you have a complete new environment thats not in production. So we gave REE a shoot. When compiling REE with got in trouble really fast and this post is about the quick fix to solve it and some of our early performance results.

The installation of REE is nothing more that unpacking ruby-enterprise-1.8.6-20081205.tar.gz and the run the installer.

tar xzvf ruby-enterprise-1.8.6-20081205.tar.gz

And after that we run


This is when our problems started.

chmod -R g+r,o+r,o-w /opt/ruby-enterprise-1.8.6-20081205/lib/ruby
Installing RubyGems...
/opt/ruby-enterprise-1.8.6-20081205/bin/ruby setup.rb --no-ri --no-rdoc
/opt/ruby-enterprise-1.8.6-20081205/bin/ruby: no such file to load -- auto_gem (LoadError)
*** Cannot install RubyGems

This one took some time to find but first I could not understand why auto_gem was not found and also why it tried to load auto_gem when the installation of rubygems is not done.

After a few minutes of thinking and digging i found my environment variable RUBYOPT which was set to -rauto_gem.


This one makes rubygems to autoload when you run something in ruby. I already had this line because i had ruby/rubygems installed before we installed REE. I still want this enviroment but not during the installation so i disabled it by starting the installer like this:

RUBYOPT="" ./ruby-enterprise-1.8.6-20081205/installer

Passing the environment variable before the command just sets it for this command.

If you do want this change permanent some digging in /etc found there is no less that 3 files where this variable is set (depending of shells).

grep -R "RUBYOPT" *
csh.env:setenv RUBYOPT '-rauto_gem'
profile.env:export RUBYOPT='-rauto_gem'

After changing this variable everything worked as expected!

So far our experience with REE is great. With plain old ruby we where running about 15 passenger (mod_rails) instances and we where using around 1.6GB memory. After The ruby enterprise upgrade we are now using 26 instances with only 1.7GB memory. CPU loads when stressing seems to be 50% less with REE and pages load times are much more stable.

You have to take these measurements with a bit of salt because we only had around an hour of testing but they seem pretty impressive so far.

I will get back with more performance data as we play.


Posted in Hosting, Programming, Rails at December 15th, 2008. Trackback URI: trackback Tags: , , , , Written by: 
  • oelmekki

    sounds simple, but I think you saved me a lot of time, thx :)

    By the way, did you ever heard of some ebuilds for ruby-ee? I couldn’t find any, and hmm… I remember the last time I installed passenger outside portage, before it got in, and letting it as-is for two major versions…

  • Mathias Stjernström


    Glad I could help! I have never heard of an REE ebuild. I did a quick google for it but found nothing interesting.

    My experience with ebuild’s on packages that’s not mainstream is not that good. I prefer to compile them myself so I can stay updated and on current version. Especially when it comes to packages that are under heavy development like REE.

    Thanks for you comment.

  • oelmekki

    Yes, you’re right and anyway, REE don’t conflict with standard ruby. Removing it simply means removing its directory in opt/ and changing the path of the passenger module and ruby interpreter in the apache conf.

    I guess I will rely on the Phusion RSS more than eix-sync for this one :)

    NB: I had to use the RUBYOPT trick when installing the passenger module from REE too ( with passenger-install-apache2-module ). I suppose it’s obvious to everyone after resolving the previous problem.

    I had a previous installation of passenger through portage that I simply uninstalled before installing the REE passenger module and I could reuse the module.d/ conf file for passenger (just changing the paths). This let us use the -D flag in /etc/conf.f/apache2 without having to write a conf file from scratch. Just wanted to report it :)

  • Mathias Stjernström

    Maybe I should post that module/conf on the blog somewhere so that we do not need to install passenger through portage just to get that file :)

    Thanks for the tip Olivier!


  • ruby on rails development

    I am quite happy with my Gentoo & Rails stack running Mongrel. However, I realize Passenger is what’s in today and it might save me a lot of time… if only it worked!

    I am trying to configure Passenger properly on Gentoo. But it seems it does not want to cooperate with my Ruby environment.

    A freshly generate rails app with the classic scaffold example (`./script/generate scaffold post title:string body:text published:boolean`) does not work with Passenger. Of course, I have no problem running it with Mongrel. I’ve been doing it for many years now.

    I wonder where’s the booboo. I see you guys installed Passenger via emerge. I opted for the gems install instead. Is that the secret to make it work on Gentoo? Or do I have a permissions issue with my rubygems?

    I use rubygems to install all packages that have their gems… There’s a handful of things for the Rails stack that I installed with portage, like apache, mysql, ruby, rubygems, mysql-ruby. The rest goes thru gems, and I thought Passenger should be dealt with the same way.

    That’s also how I deal with things on my Mac OS X development environment. Anyway, I’ll try to reinstall it via Portage. If you have any clues, throw some my way 😉



  • Mathias Stjernström

    Hi Seb!

    Thanks for your comment!

    We do not run passenger from portage. When we started to use passenger it wasn’t even in there :)

    We do it like the instructions on says:

    gem install passenger

    Nothing more fancy. What kind of error do you get??

  • ruby on rails development

    Oh well. I removed the gem and reinstalled it via portage. Anyway, I had the same problems going on.

    In the end, it was a blatant permissions issue. As the user running passenger could not read my gems.

    Now I know that a “no such file to load” error in Ruby means you have a permissions issue. Although it was pointing me at first to mysql connector issues, or initializer issues.

    Even though the whole message might be: “”Please install the mysql adapter: `gem install activerecord-mysql-
    adapter` (no such file to load — active_record/connection_adapters/
    mysql_adapter)”. ”
    Pay only attention to the “no such file to load” part.

  • Mathias Stjernström


    Thanks for sharing. Sometime error messages can be sooooo misleading :)

  • Pingback: Asterisk - Voip Server Installation on Linux - Centos()

It's past my bedtime is using WP-Gravatar