A mongrel endorsement and A manual fix for installing mongrel on Solaris 10/11

We had ported our Rails application Strongspace to Solaris at the end of 2005 after ZFS was released in Solaris Nevada Build 27a (I’ll explain the difference between Solaris 10, Solaris Nevada, Solaris Express and Opensolaris in a following post), and began building hooks into the ZFS filesystem for the application to use.

But we ran into a bit of a problem: FastCGI for Ruby absolutely sucked on Solaris (sure people see zombies on FreeBSD but the fact is it did simply Just Work™ on FreeBSD, right out of ports). I remembered when reading and then remarking on Mark’s essay that I think the entire world should just be straight up http and I started burning some candles for an http-based way of serving up Rails to appear before we had to build it ourselves.

Thus enter Mongrel. And it’s not a coincidence by the way that that we rolled out the ZFS-using Strongspace and our own Connector on Solaris in April after the release of the Rails 1.1 supporting and solid Iron Mongrel

Mongrel if you don’t know is the creation of Zed Shaw and according to it’s site is “a fast HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI.”

But.

As was recently pointed out on the mailing list by Dan Berger, the default “gem install mongrel” doesn’t get it all installed on Solaris.

So here is how you do it.

This assumes CC is available and in your path (we use the CC from Sun Studio), and is also using the ruby from the blastwave system.

Do the normal

gem install mongrel

And watch it fail. It will likely say something like

"http11.c", line 47: warning: syntax error: empty declaration
"http11.c", line 48: warning: syntax error: empty declaration
"http11.c", line 49: warning: syntax error: empty declaration
"http11.c", line 50: warning: syntax error: empty declaration
"http11.c", line 51: warning: syntax error: empty declaration
"ext/http11/http11_parser.rl", line 58: warning: statement not reached
ld: final link failed: Bad value
make: *** [http11.so] Error 1
ld: final link failed: Bad value
make: *** [http11.so] Error 1

The two ways of manually fixing this is

Way Numero Uno

Move yourself into the ruby gem directory

$ cd /opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/ext/http11/

Add CONFIG['INSTALL'] = "/opt/csw/gnu/install" to extconf.rb right under the require ‘mkmf’ statement and then

$ ruby extconf.rb
$ make install

Way Numero Dos

Move yourself into the ruby gem directory

$ cd  /opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/ext/http11
$ vi  /opt/csw/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/ext/http11/Makefile

Change the line

#INSTALL = /export/home/comand/bin/install -c

to

INSTALL = /opt/csw/gnu/install -c

And change

CFLAGS   =  -KPIC -xO3 -xarch=v8 -xspace -xildoff -I/opt/csw/include  -I/opt/csw/include   -KPIC

to

CFLAGS   =  -I/opt/csw/include  -I/opt/csw/include

And All Praise Be To Mongrel. For without it, deploying on our favorite operating system would not have been possible.

3 Comments

  1. Edgar
    Posted July 22, 2006 at 5:45 pm | Permalink

    I was hoping that you were going to talk about your experience with Mongrel.

    Is it good? How much faster has it improved the responsiveness of your web-apps etc…?

  2. Justin Chen
    Posted August 11, 2006 at 7:21 am | Permalink

    Thanks for posting this Jason! It worked like a charm. I’m surprised that the latest versions of mongrel still needs this fix though. I just installed the 0.3.14.4 prerelease on our new solaris container.

  3. Posted October 5, 2006 at 9:28 pm | Permalink

    Alternatively, if you don’t use Blastwave you can use Method 1 above but instead use ”/usr/ucb/install” rather than the one in /opt/csw.


Post a Comment

You must be logged in to post a comment.
Follow

Get every new post delivered to your Inbox.

Join 49 other followers