Posted on Dec 19, 2007

Latest RubyGems and Rails is a deadly combo

2007-12-20: RubyGems 1.0.0 is out, including mswin32 fixes. There is a problem specific on how gem_plugin search for gems and their platforms, that makes mongrel_service gem fail.

The recommended update procedure will be:

  1. Update RubyGems using gem update --system
  2. Go into your lib/ruby/gems/1.8/gems and rename mongrel_service-0.3.3-mswin32 to mongrel_service-0.3.3-x86-mswin32 (note the x86 addition).
  3. Star mongrel_rails normally.

The problem is related to gem_plugin and how it determines de platform path. Also, reinstalling the gem shows other problems with dependencies trying to get compiled. I’ll solve them and do a proper release later today.

Back to the informative post

It seems a lot of folks are upgrading their Rails installation. For the Windows-only guys out there: please wait.

I just hope all the Ruby folks on Windows don’t get mad at me1.

My fingers start hurting replying mails and closing duplicate tickets about this, so, making a short list of it:

  1. Rails 2.0.x forces you update to RubyGems 0.9.5
  2. RubyGems 0.9.5 is broken for platforms that provides pre-built gems.
  3. Mongrel provides a pre-built gem for those who don’t have a compiler under Windows (90% of the cases).
  4. Even you get Rails installed, it wouldn’t boot, since it couldn’t get Mongrel running.
  5. Folks start yelling at ruby-talk, mongrel-users and other places about this.

Please, hold your anxiety a bit

  • Rails guys did fix this (changeset 8438)
  • A new Rails release (2.0.3 maybe?) is comming soon.
  • A new RubyGems version that fix this scenario is comming soon too (1.0)
  • Mongrel and all the gems related to it (mongrel, mongrel_service and fastthread) are being fixed to solve further issues with this bad behavior

Why this chaos?

Chaos is everywhere, and some times is good. ;-)

But honestly, this global break is a necessity: upcoming version of Ruby (1.9.1) will ship with RubyGems bundled. Part of this decision required automatic handling of platforms — remember the 6 or more listed gems for platforms you don’t care about? — the same is gone for good.

Automatic platform handling to cover all the platforms, OS and compilers Ruby run is complex. Some gems developers (including myself) were using the wrong platform to identify native pre-built gems. This also covers others gems like sqlite, mysql and ruby-debug to name a few.

This should have been fixed before, but 9K gems rubyforge provides is kind of difficult to track which one will break, don’t you think?

Anyway, just a simple summary of the situation.

1 Is not all my fault, ok?

14 Comments

  • That’s not rails or rubygems devs faults. They write the code that is best (for unix) and if it doesn’t work on Windows, it’s our fault to be using Windows…

    Windows folks, just use linux, or mac if you got cash.

    ubuntu is straight forward install and use.

    Cheers. :)

  • Luis says:

    Frederico, you won!

    That’s the worse answer I think someone could write to this post! :-D

    BTW, ubuntu is another nightmare, don’t install rubygems from apt-get and try ‘gem update –system’

    Leopard is broken too, do a search.

    So I guess all the OS have their own issues. Hate them, love them, they still are a necessity :-)

  • Thanks a lot for explaining Luis. And I really also want to thank you personally for taking your time to answer my initial request on this issue weeks ago.

    I’ll cross link to this explanation from Justaddwater: Rails 2.0, gem install, Windows => Mongrel Trouble

  • Link to article did not show up. Here is the link (repeated in the URL field).

    http://justaddwater.dk/2007/12/09/rails-20-gem-install-windows-mongrel-trouble/

  • [...] Latest RubyGems and Rails is a deadly combo (December 19) [...]

  • Thorsten says:

    Installing Rubygems 0.9.4 solved the problem for me …

  • Scott Schram says:

    RubyGems 1.0.0 was released today. I’m not sure if it fixes the problems with Leopard and GEM_HOME, GEM_PATH yet.

    http://blog.segment7.net/articles/2007/12/20/rubygems-1-0-0

  • Luis says:

    Thank you Scott for the link.

    Yesterday I worked with Eric fixing the backwards compatibilities issues of RubyGems and existing ‘mswin32′ gems like Mongrel, Hpricot and others.

    1.0.0 ships with these fixes.

    Regarding Leopard I cannot comment, but there is a open ticket for GEM_HOME and GEM_PATH on Windows that is tricky to solve right now (and I decided to pospone it for the time being).

  • [...] Luis Lavena:Latest RubyGems and Rails is a deadly combo [...]

  • Well, true.
    Ubuntu apt-get totally sucks, it can be a nightmare.
    you can always try Centos, Slackware, or even Gentoo
    but its better than “Windowz” :)

    all you need to do is get the Source Files and install them. (ruby, rubygems, etc…)

    OSX is not broken that I know.
    I have both OSX 10.4 and 10.5. None which I had problems.

    see how easy in OSX:
    1. download and install Macports (www.macports.org)
    2. $ sudo port install ruby

    3. download and install rubygems
    or
    $ sudo port install rb-rubygems

    Leopard is shipped with ruby1.8.6, rubygems and tons of gems, including mongrel.

    for OSX Tiger 10.4, which has old ruby version,
    just add this at the end of your .bashrc or .bash_profile, so you will be using latest ruby from macports, which installs in /opt/local

    export PATH=/opt/local/bin:$PATH

  • Allan Benamer says:

    Luis, I’m having problems with Mongrel on my VPS server running Ubuntu Gutsy. My error happens every time I try to start Mongrel.

    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — daemons/daemonize (LoadError)
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/configurator.rb:189:in `daemonize’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:92:in `cloaker_’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/configurator.rb:50:in `call’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/configurator.rb:50:in `initialize’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:84:in `new’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:84:in `run’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/../lib/mongrel/command.rb:212:in `run’
    from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:281
    from /usr/bin/mongrel_rails:19:in `load’
    from /usr/bin/mongrel_rails:19

    I noticed that you worked with Eric Hodel trying to fix this problem on Win32 platforms but I’m here to tell you it’s happening on Ubuntu as well. I’ve tried installing rubygems 0.9.4 and moving ahead with installing Mongrel as well but I’m still having problems…

  • Luis says:

    Allan, you should report this to mongrel-users, but anyway:

    The error message clearly states that you’re missing daemons gem:

    gem install daemons

    I worked with Eric fixing other problems, not this :-)

    Also, if you mixed apt-get installed ruby and rubygems you will have a nightmare trying to figure out where is actually the problem.

    If mongrel or rubygems was working for you before, you should follow the “don’t fix ain’t broken” motto :-D

  • [...] onto resolving the mongrel failure problem. After digging around the net, I came across Latest RubyGems and Rails is a deadly combo. As it turns out all I need to do is go into c:rubylibrubygems1.8gems and rename [...]

  • Srikanth says:

    Hi Luis

    I am unable to get mongrel service to be either installed or using mongrel_rails to start redmine. i have followed what you have specified here:

    http://www.ruby-forum.com/topic/165986#728443

    but when i try to install mongrel service as shown below, i get this error

    C:\Ruby\apps>gem install –local mongrel_service-0.3.4-i386-mswin32.gem
    ERROR: While executing gem … (Gem::Package::FormatError)
    No metadata found!

    C:\Ruby\apps>

    since i am a novice at ruby, if i tried this command after that, i get an error (obviously)

    C:\Ruby\apps>mongrel_rails service::install -N Redmine -c C:\Ruby\apps\redmine -
    p 80 -e production
    ERROR RUNNING ‘service::install’: Plugin /service::install does not exist in cat
    egory /commands
    Use help command to get help

    C:\Ruby\apps>

    Please can you help me on this so that I can get my redmine running. Why has software installation got to be so tough! ….