Phusion, The Computer Science Company | Chamber of Commerce no 08173483 (Apeldoorn, The Netherlands) | info@phusion.nl

Getting ready for Ruby 1.9.1

We are excited about Ruby 1.9.1. Of course, with all the performance improvements, who wouldn’t be? Unfortunately a large number of Ruby libraries and extensions still don’t work on 1.9.1, so Ruby 1.9 cannot be considered production-ready yet. Ryan Bigg has done an excellent job on documenting most of the problems that one would encounter when trying to get a basic Rails app up-and-running on Ruby 1.9.1. Basically, the problems he countered were:

  • 2.2.2 isn’t compatible with 1.9.1. Use Rails 2.3.0 RC1 or Rails edge.
  • The mysql gem needs patching.
  • The hpricot gem needs patching.
  • The postgres gem needs patching.
  • Thin needs patching.
  • The fastthread gem needs patching.
  • Mongrel needs patching.

But what about Phusion Passenger? Good news:
Phusion Passenger is Ruby 1.9.1-compatible since this commit (today).

Here’s a screenshot of a Rails 2.3.0 app running in Phusion Passenger on Ruby 1.9.1:

passenger-ruby19

Do you see the changes? Me neither. That’s the point. :)

We’ve encountered the following issues upon trying to get a simple Rails 2.3 app up running with Phusion Passenger and Ruby 1.9.1:

Fastthread isn’t compatible with 1.9
Both Mongrel and Phusion Passenger depend on Fastthread, which is a threading library that fixes some threading implementation bugs in older versions of Ruby 1.8. Fastthread is only a required dependency when running on older versions of Ruby 1.8. Unfortunately there’s no way to tell RubyGems “we depend on fastthread, but only when running on older versions of Ruby 1.8, and not on JRuby”.

Fastthread doesn’t compile on Ruby 1.9 (or on JRuby or other Ruby implementations for that matter), so when you type “gem install passenger” or “gem install mongrel” on Ruby 1.9, the installation fails with a ton of compile errors.

We’ve patched fastthread so that it becomes a no-op on Ruby 1.9.1 and on JRuby (that is, fastthread will install correctly but it won’t do anything). These patches have been submitted to Mentalguy, the maintainer of fastthread.

The sqlite3-ruby gem doesn’t work on 1.9
Jeremy Kemper submitted a 1.9 compatibility patch in the past, which had been committed. Unfortunately even with this patch, sqlite3-ruby isn’t compatible with 1.9.1.

We’ve gone ahead and fixed 1.9.1 support. The patch can be found here: http://rubyforge.org/tracker/index.php?func=detail&aid=23792&group_id=254&atid=1045

Hongli Lai Ninh Bui

26 Comments »

  1. It’s always good to see the Ruby community evolving and Passenger have never been an exception. Well done guys, I’m sure this change will make a huge difference. Passenger <3

    Comment by Attila Györffy — February 2, 2009 @ 12:47 pm

  2. Nice work. Thanks guys.

    Comment by nap — February 2, 2009 @ 1:00 pm

  3. great news & good work!

    hopefully we can switch to 1.9 soon…

    Comment by grosser — February 2, 2009 @ 1:30 pm

  4. This is great news, I refuse to deploy with anything other then passenger!

    Comment by rubylicio.us — February 2, 2009 @ 3:29 pm

  5. Does ruby 1.9.1 offer any memory benefits when using Passenger? REE gets benefit from CoW, etc. Out of the box will Ruby 1.9.1 get anything like this or might there be a REE 1.9.1?

    Comment by Hunter — February 2, 2009 @ 4:47 pm

  6. @Hunter: Ruby 1.9.1’s garbage collector is not copy-on-write friendly, so no.

    Comment by hongli — February 2, 2009 @ 5:08 pm

  7. Wordpress’s admin interface is malfunctioning. Kyle said:

    @hongli: no benefits out of the box, or no REE 1.9?

    The answer is: no benefits out of the box.

    Comment by hongli — February 3, 2009 @ 2:33 am

  8. Will there be a way to run some sites on 1.9 and some sites on 1.8?

    I would like to have
    /opt/ruby-enterprise-1.8-20090129
    /opt/ruby-enterprise-1.9-20090129

    and configure passenger on a per-site basis which one to use.
    Will this be possible or do I need a separate (virtual) machine for this?

    Thanks!

    Comment by Mathijs — February 3, 2009 @ 5:05 am

  9. Matthijs: You don’t need seperate virtual machines, you just need seperate Apache instances, one running Ruby 1.8 and one running Ruby 1.9. Put both Apaches behind a single reverse proxy or load balancer if you want them to be accessible from the same IP+port.

    Comment by hongli — February 3, 2009 @ 5:17 am

  10. [...] As stated here, passenger is compatible with Ruby 1.9.1. This has been used to run a Rails 2.3 test application without issue. [...]

    Pingback by The Life Of A Radar » Blog Archive » Ruby 1.9.1 & Friends — February 3, 2009 @ 5:18 am

  11. [...] Getting ready for Ruby 1.9.1 – Passenger is 1.9.1 compatible now, and they’ve got patches for fastthread and sqlite. [...]

    Pingback by Double Shot #383 « A Fresh Cup — February 3, 2009 @ 7:23 am

  12. Great job!!!
    So in terms of speed and performance, is it better to go with ree or ruby 1.9.1? I would think that using ruby 1.9.1 is probably more efficient/faster.

    Comment by sanbit — February 5, 2009 @ 9:30 am

  13. 1.9.1 is faster.

    Comment by hongli — February 5, 2009 @ 9:40 am

  14. Are you planning on a REE version of 1.9 and 2.0? Certainly the COW and tcmalloc features would be great additions.

    Comment by Roderick van Domburg — February 10, 2009 @ 5:20 pm

  15. Just in case you missed it, nobu has added a couple of interesting comments to the commit on GitHub.

    Comment by Roderick van Domburg — February 10, 2009 @ 5:29 pm

  16. [...] Ficando pronto para o Ruby 1.9.1 – Os caras da Phusion (por trás do excelente Passenger /mod_rails) dão algumas dicas sobre aplicações Rails rodando no Ruby 1.9.1. Eles explicam o que devemos modificar para o Rails 2.3, que vai precisar de patchs para um monte de gems, mas o último release do Phusion Passenger irá funcionar bem com o Ruby 1.9.1. [...]

    Pingback by 23 links e recursos úteis do Ruby 1.9 — February 12, 2009 @ 10:39 pm

  17. [...] to have problems. Ryan Bigg detailed a list of issues that come up with using Rails on 1.9.1. The Phusion Passenger blog reports that their most recent version is compatible with 1.9.1, and detail which libraries [...]

    Pingback by Ruby 1.9.1 Library Compatibility Roundup | Xingyu.zhang's Technology Circle — February 13, 2009 @ 3:23 am

  18. [...] Getting ready for Ruby 1.9.1 – The Phusion guys (behind the excellent Passenger / mod_rails) give some tips regarding running Rails apps on Ruby 1.9.1. They explain that you must move on up to Rails 2.3, that you’ll need to patch a ton of gems, but that the latest build of Phusion Passenger will work happily with Ruby 1.9.1. [...]

    Pingback by 23 Useful Ruby 1.9 Links and Resources « A little story — February 13, 2009 @ 7:53 am

  19. @Roderick: We plan on porting the functionality to the 1.9 series in the long term.

    Github disabled the comments feed, so I can’t find nobu’s comment. Could you provide a link?

    Comment by hongli — February 13, 2009 @ 8:57 am

  20. It’s right underneath the commit at http://github.com/FooBarWidget/passenger/commit/0e43297b18f03e8b01c7c40897925b2ede6bc831.

    Comment by Roderick van Domburg — February 14, 2009 @ 7:27 am

  21. [...] Getting ready for Ruby 1.9.1 [...]

    Pingback by Listão de links sobre Ruby 1.9 | Ruby Brasil — February 14, 2009 @ 10:47 pm

  22. Sweet! I’m going to try this out next weekend on a new slice and see how it goes. Hopefully people start making their gems 1.9.1 compatible in a hurry. Thanks for the amazing work Hongli and team!

    ~ Mel

    Comment by BrainBank — February 15, 2009 @ 3:23 pm

  23. with 1.9.1’s native threading, what happens when you enable config.threadsafe! in production.rb and fire up passenger? dare i dream?

    Comment by Micah Geisel — February 16, 2009 @ 5:05 am

  24. [...] Getting ready for Ruby 1.9.1 – The Phusion guys (behind the excellent Passenger / mod_rails) give some tips regarding running Rails apps on Ruby 1.9.1. They explain that you must move on up to Rails 2.3, that you’ll need to patch a ton of gems, but that the latest build of Phusion Passenger will work happily with Ruby 1.9.1. [...]

    Pingback by 23 Useful Ruby 1.9 Links and Resources — February 18, 2009 @ 4:42 am

  25. [...] As announced here. [...]

    Pingback by Phusion Passenger 2.1.1 (beta) released, thanks sponsors! « Phusion Corporate Blog — April 3, 2009 @ 3:01 pm

  26. Hi,

    Well wanted to announce that latest passenger and ruby 1.9.1 is not working for me.
    Without passenger I have a simple scaffolded app running here (regular script/mongrel)
    http://85.10.204.201:3000/books

    With passenger, same app, same environment/server/database only now passenger serves the app and it runs here:
    http://85.10.204.201/books -> crashes on destroy, delete, update actions (which are just default scaffolded actions).

    I don’t seem to get answers on my ticket about this so might as well post it here.
    Hope u can fix this soon cause I love passenger+rails ;) It basically gives me a 500 error and nothing is stated in apache logs nor development.log cause the app is just killed by passenger whenever it tries to write to database (or is it a session/cookies issue?).

    Kind regards,
    W.

    Comment by Walter Schreppers — August 6, 2009 @ 11:53 pm

Leave a comment