Error while installing Rails using gem install rails

I've got this error, while trying to do

gem install rails

Bulk updating Gem source index for:
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install rails -y
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
        --ruby=C:/Program Files/ruby/bin/ruby

Gem files will remain installed in C:/Program Files/ruby/lib/ruby/gems/
fcgi-0.8.7 for inspection.
Results logged to C:/Program Files/ruby/lib/ruby/gems/1.8/gems/

I've tried with Ruby1.8.6.25 and Ruby1.8.6.26, with the same

Can someone help me...??

Thanks in advance!!


What's that?? Where can I find it...??? How Can I install it???

What's that?? Where can I find it...??? How Can I install it???

A red herring. On many linux distros ruby is split into several
packages, this of course doesn't apply if you are on windows. The
error you are getting is gem failing to install the fcgi gem (probably
because you don't have an appropriate compiler) but I'm not sure why
it's trying in the first place - fcgi is pretty much dead as a method
of deploying rails these days and I don't think it was ever a
dependency of rails.


I was getting the same error. Install the fcgi header files with this
sudo apt-get install libfcgi-dev