Do you get header not found errors when installing a Ruby Gem? (In my case, it's the FastCGI bindings.)
The problem looks something like this:
~/rubygems-0.8.11 >>> mars >>> ~/bin/gem install fcgi
Attempting local installation of 'fcgi'
Local gem file not found: fcgi*.gem
Attempting remote installation of 'fcgi'
Building native extensions. This could take a while...
ERROR: While executing gem ... (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /home2/mars/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1 for inspection.
ruby extconf.rb install fcgi\nchecking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
This error is because the header [*.h] files are:
Not installed; If "fcgiapp.h" is the problem, make sure you've installed the FastCGI Dev kit.
In a non-standard location; the Ruby Gem configuration script "extconf.rb" doesn't search in Ruby's originally compiled include directory (the directory that was specified using the "--includedir" option when Ruby was built.)
Instead, ya gotta get all specific using the CONFIGURE_ARGS environment variable:
In c shell [tcsh]:
setenv CONFIGURE_ARGS "with-fcgi-include=/path/to/include"
In sh [bash]:
export CONFIGURE_ARGS="with-fcgi-include=/path/to/include"
Make sure to replace the 'fcgi' in that value with your problematic Gem's name & '/path/to/include' with the path to your special include directory.
Then, try your "gem install" again!
Excellent it worked :)
Woot!
This helped me fix my gems on an out-of-date shared host. Thanks!