Hatena::ブログ(Diary)

urekatのスカンク日記3 このページをアンテナに追加 RSSフィード

2007-10-02

[][][]macbookgem install mysql

tkrmb:~% sudo gem install mysql   
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i686-darwin8.9.1)
 1. mysql 2.7.3 (mswin32)
 2. mysql 2.7.1 (mswin32)
 3. mysql 2.7 (ruby)
 4. mysql 2.6 (ruby)
 5. Skip this gem
 6. Cancel installation
> 3
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 mysql
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... 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
        --ruby=/opt/local/bin/ruby
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib


Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out

tkrmb:~% locate libmysqlclient
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.15.0.0.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.15.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.a
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.15.0.0.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.15.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.a
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.dylib


tkrmb:~% sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
Need to update 1 gems from http://gems.rubyforge.org
.
complete
Select which gem to install for your platform (i686-darwin8.9.1)
 1. mysql 2.7.3 (mswin32)
 2. mysql 2.7.1 (mswin32)
 3. mysql 2.7 (ruby)
 4. mysql 2.6 (ruby)
 5. Skip this gem
 6. Cancel installation
> 3
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
tkrmb:~% ./script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
dyld: NSLinkModule() error
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
  Referenced from: /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
  Reason: image not found
zsh: trace trap  ./script/server

そのファイル、そのパスには無いのでシンボリックリンクをはる。

 # cd /usr/local/mysql/lib
 # mkdir mysql
 # cd mysql
 # ln -s /usr/local/mysql/lib/lib* .

http://www.railsforum.com/viewtopic.php?pid=26135#p26135

http://d.hatena.ne.jp/Fumio/20070724#1185290977

おけー。

gammegamme 2008/03/07 04:38 最後のやつ、同じエラーを受け取って困っていました。救われました!
ありがとうございます。
ちなみに、私が試みていたのは、Intel Macへのphp5.2.5のソースからのインストールです...

スパム対策のためのダミーです。もし見えても何も入力しないでください
ゲスト

コメントを書くには、なぞなぞ認証に回答する必要があります。