Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Apache Passenger , Ruby Development Headers Not Found

I have a RoR app that needs to be hosted on Apache, so I have been trying to install Apache Passenger. When I run the following command:

sudo passenger-install-apache2-module

I get:

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * Curl development headers with SSL support... found
 * OpenSSL development headers... found
 * Zlib development headers... found
 * Ruby development headers... not found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at /usr/local/bin/rake
 * rack... found
 * Apache 2... found at /usr/sbin/apache2
 * Apache 2 development headers... found at /usr/bin/apxs2
 * Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config
 * Apache Portable Runtime Utility (APU) development headers... found at /usr/bin/apu-1-config

So it asked me to run the following command:

sudo apt-get install ruby1.8-dev

and I have done this with the following result

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby1.8-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.

So when I run:

sudo passenger-install-apache2-module

I get the same result asking me to run:

sudo apt-get install ruby1.8-dev
like image 841
Wael Said Emara Avatar asked Feb 17 '12 20:02

Wael Said Emara


3 Answers

If, like me, you are running the apt package ruby1.9.1 instead of 1.8 then install ruby1.9.1-dev instead

sudo apt-get install ruby1.9.1-dev

This worked for me. Hope it helps.

like image 151
mattl Avatar answered Nov 15 '22 05:11

mattl


After installing the missing headers, go back to the beginning and recompile passenger:

gem install passenger
like image 43
Noddinoff Avatar answered Nov 15 '22 04:11

Noddinoff


Try uninstalling ruby1.9 and installing ruby1.8 instead then reinstall the passenger gem. This worked for me.

like image 29
ben Avatar answered Nov 15 '22 04:11

ben