gemのインストール中にfcgiでエラーになる

Rails2.0をインストールすべく、奮闘中にいきなりつまづいてしまった。

Rubyこちらよりruby186-26.exeをダウンロードしてインストール。
次に、スタートメニューのプログラムから「Ruby-186-26」を選び、「RubyGems」の中より「RubyGems Package Manager」を選択し、起動します。
んでもって、以下のコマンドを入力

c:\ruby>gem install rails --include-dependencies

そうしたら以下のようなエラーが・・・

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 --include-dependencies
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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--srcdir=.
--curdir
--ruby=c:/ruby/bin/ruby
--with-fcgi-dir
--without-fcgi-dir
--with-fcgi-include
--without-fcgi-include=${fcgi-dir}/include
--with-fcgi-lib
--without-fcgi-lib=${fcgi-dir}/lib


Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/fcgi-0.8.7 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/fcgi-0.8.7/ext/fcgi/gem_make.out

どうやら、fcgiが原因のようです。

昨日も別のPCで同様の事態に陥りつまづきました。
そのときは以前インストールしていたRails1.2系のものが影響しているのかと奮闘してなんとかなったので、今回も同様にRails1.2系を含むいろいろなものを退避した上で削除し挑んでみたけど同様のエラー。

なんやかんやで、どうも昨日との差異はgemのバージョンにあるっぽいので以下のコマンドでアップデート

c:\ruby>gem update --system

上書きのものはとりあえず「Y」で上書きして・・・



RubyGems system software updated

どうやら上手くアップデート出来たみたい。


確認のためgemのバージョンを確認すると

c:\ruby>gem -v
1.3.5

無事アップデート出来たみたいなので、もう一度Railsのインストールに挑戦。

c:\ruby>gem install rails --include-dependencies
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Successfully installed rack-1.0.0
Successfully installed actionpack-2.3.3
Successfully installed actionmailer-2.3.3
Successfully installed activeresource-2.3.3
Successfully installed rails-2.3.3
5 gems installed
Installing ri documentation for rack-1.0.0...
Installing ri documentation for actionpack-2.3.3...
Installing ri documentation for actionmailer-2.3.3...
Installing ri documentation for activeresource-2.3.3...
Installing ri documentation for rails-2.3.3...
Installing RDoc documentation for rack-1.0.0...
Installing RDoc documentation for actionpack-2.3.3...
Installing RDoc documentation for actionmailer-2.3.3...
Installing RDoc documentation for activeresource-2.3.3...
Installing RDoc documentation for rails-2.3.3...

いよっし!出来た!
Railsのバージョンを確認してみると・・・

c:\ruby>rails -v
Rails 2.3.3

うむ。上手くいっているようです。