Posted
23 July 2009 @ 2pm

Tagged
, , , , ,

Share and Enjoy
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Digg
  • Twitter
  • Reddit
  • MySpace
  • Technorati
  • StumbleUpon
  • Tumblr
  • Slashdot
  • email
  • Print

Rails 2.3.1+, Passenger, and Rack 1.0

Just an FYI for those of you running the latest stable Rails.

Rails 2.3.1+ depends on Rack 1.0.  In 2.3.1, it only uses the vendor’d version of Rack 1.0 (which is located under action_controller/vendor).  In 2.3.2, it can use a vendor’d version of Rack 1.0 if the gem isn’t installed in your system.  Rails 2.3.3 depends on the Rack 1.0 gem and no longer contains vendor’d Rack.  I haven’t found any reasons for why this has changed between point releases.

Either way, Rack 1.0 needs for the rack.input to be seekable.  It calls rewind on said input.  Passenger < 2.2.2 passed a UnixSocket as rack.input, which is not seekable.  This will produce the following error in your Rails app:

/!\ FAILSAFE /!\ Thu Jul 23 10:57:14 -0700 2009
Status: 500 Internal Server Error
undefined method `rewind' for #<UNIXSocket:0x2add0f3f45a0>

So, to repeat.  If you’re running Rails in 2.3.1+, you need Rack 1.0, which needs Passenger 2.2.2+.  There have been various efforts by all sorts of software including Facebooker to work around this problem, but those seem to have sometimes caused more issues.

Incidentally, Dreamhost currently has Passenger 2.1.2 installed.  *sigh*

References:

Oh, and I also learned that if there’s a particular commit in Github that you’d like to apply to your own source tree (say, for instance, the patch that removes vendor’d rack 1.0 from Rails which you’d like to reverse), you can simply add .patch onto the end of the URL and you’ll get the relevant patchfile.  Github rocks!

UPDATE: Dreamhost has upgraded their versions of Passenger and Rack, and Rails 2.3.3 is now working.  Thanks Dreamhost!


  • Tyler
    It appears that Passenger 2.2.4 will seg fault on Solaris 10 . 2.2.2 works fine for me, at least on a Joyent Shared Accelerator running Solaris.
  • Passenger and Rack have both been updated and Rails 2.3.3 is running successfully. Thanks Dreamhost!
  • Right. But the problem I'm currently having is with the out-of-date Passenger version. I can put the newer Rack and Rails code in my source tree, if necessary, which is how users are currently instructed to run newer versions via your Wiki.

    If you'd upgrade Passenger to 2.2.2+ (stable is 2.2.4) in the meantime, there would be both a short-term and a longer term fix for the problem.
  • dreamhosthoncho
blog comments powered by Disqus
Rails running in script/console? authlogic_oauth gotcha