Snow LeopardにUpgradeしたらやはりRailsが動かない件
64bit化に伴いMacPortsとRubygemsが死んじゃうよって話は
Snow Leopardにアップデートした後に気をつけること 主にMacPortsとrubygemsについて - mizchi log
このあたりで語られていましたが
とりあえずRailsを動かしたいです。
http://journal.mycom.co.jp/news/2009/09/01/033/index.html
Upgrading to Snow Leopard | Riding Rails
基本的には上の通りにMacPortsを再構築して、PassengerはとりあえずMongrelで動かすから無視して
MySQLは公式からx86_64を入れ直しなどなど。
一点だけ上記の通りに行かなかったのがMySQLドライバで以下のようなエラーが出る。
gem uninstall mysqlの後に
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 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... no 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 --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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 --with-mygcclib --without-mygcclib --with-mysqlclientlib --without-mysqlclientlib Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
(これ以前も同じエラーでた。--with-mysql-configが間違ってなければ通るはずなんだけども……
と思いつつgemがおかしいんじゃ?と勝手な憶測のもと
$sudo gem update --system
とやっても既にLeopardの時にいれたgem 1.3.5と最新なせいか何も変更してくれない。
もう一つの方法らしいrubygems-updateの方を試してみると
$ sudo gem install rubygems-update Password: Successfully installed rubygems-update-1.3.5 1 gem installed Installing ri documentation for rubygems-update-1.3.5... Installing RDoc documentation for rubygems-update-1.3.5... Could not find main page README Could not find main page README Could not find main page README Could not find main page README $ sudo update_rubygems Installing RubyGems 1.3.5 RubyGems 1.3.5 installed === 1.3.5 / 2009-07-21 Bug fixes: * Fix use of prerelease gems. * Gem.bin_path no longer escapes path with spaces. Bug #25935 and #26458. Deprecation Notices: * Bulk index update is no longer supported (the code currently remains, but not the tests) * Gem::manage_gems was removed in 1.3.3. * Time::today was removed in 1.3.3. ------------------------------------------------------------------------------ RubyGems installed the following executables: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
再度mysqlのgemにチャレンジ
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config Building native extensions. This could take a while... Successfully installed mysql-2.8.1 1 gem installed
No definitionがたくさん出るけどとりあえずRailsが動くまではできた。
なんだかよくわかりませんが。
結論:クリーンインストールしたほうがいい?