よかろうもん!

アプリからインフラまで幅広くこなすいまどきのクラウドエンジニアが記す技術ブログ

Ubuntuでgemのfcgiをインストールする際に必要となるパッケージ

自宅や会社のPCにfcgiのgemをインストールする際に、いつも以下のエラーが出力されてて、それをググっているので、自分用のメモとして記録しておく。

$ sudo gem install fcgi
 
Building native extensions. This could take a while...
ERROR: Error installing fcgi:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install fcgi
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
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--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 /var/lib/gems/1.8/gems/fcgi-0.8.7 for inspection.
Results logged to /var/lib/gems/1.8/gems/fcgi-0.8.7/ext/fcgi/gem_make.out
interu@ubuntu:~/project/skip$ sudo gem install libfcgi-dev
ERROR: could not find gem libfcgi-dev locally or in a repository

このエラーが出力された場合は、fcgiのパッケージ以外に、以下のfcgiのパッケージをインストールすることで解決するはず。

$ sudo apt-get install libfcgi-dev