Google Analytics

Monday, June 01, 2009

Installing the Passenger gem on Ubuntu

I just tried to install Passenger on my Ubuntu-based Linode. I like to use the gem (as opposed to distro packages) to make sure I keep up with new version releases. Unfortunately when I tried I got this error:

# gem install passenger
Building native extensions.  This could take a while...
ERROR:  Error installing passenger:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install passenger
extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)
        from extconf.rb:8

Since the machine is a VPS I like to try and keep the number of unnecessary packages down to a minimum. It turns out the only extra package I needed to install was ruby1.8-dev.

After Passenger built successfully, I had to add /var/lib/gems/1.8/bin into my $PATH and run passenger-install-apache2-module (which contained cushy step-by-step instructions from that point on).

6 comments:

Unknown said...

John Ferlito put together some up to date Passenger debs for Hardy => Jaunty, and has published them in his Launchpad PPA:

https://launchpad.net/~johnf-inodes/+archive/mod-passenger

I'd recommend using them over the RubyGems distribution.

Ross Lazarus said...

more recently, ubuntu 10.10, apt-get install ruby-dev worked for me

Rahul Bhardwaj said...

Yup......its works for me too...Thanks mate!!

Rahul Bhardwaj said...

Yup ..its works for me too .....Thanks mate!!

Anonymous said...

Thanks ..
This helped .. otherwise I would have wasted a lot of time ..

Ruby dependencies are a hell .. and I hope this gets fixed

Anonymous said...

Nice. Very helpful thanks!