Rubyのインストール

特筆することもないけど、メモ。
ここらへんからダウンロード。

展開して、下記のようにmake & install

RUBY_VERSION=1.8.7
PREFIX=$HOME/local

cd ruby-1.8.7-p249/
./configure --prefix=$PREFIX --program-suffix=$RUBY_VERSION
make && make install

RUBY="ruby$RUBY_VERSION"
cd rubygems-1.3.5
$RUBY setup.rb config --prefix=$PREFIX
$RUBY setup.rb setup && $RUBY setup.rb install


gem1.8.7 install mysql をすると下記のエラーが発生

kasuya@proe:~/local/bin$ ./gem1.8.7 install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/home/kasuya/local/bin/ruby1.8.7 extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... 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
       ......

ヘッダーファイルとかないのかな、と思ったので

aptitude install libmysqlclient15-dev

をして再度

gem install mysql

を実行したらでけた。


終了