2012年6月27日水曜日

libv8を入れているのに、therubyracerがエラーになる

heroku master使いたい→通らない(gitでつまづく)→原因はlibv8にあるようだ→入れたのに通らない→brew doctor使うとパスが通っていない→パスを通す(brew doctorのパスエラーは消えた)→libv8アンインストールさせたので、再度gem update→(libv8が最新版と3.3.10.4の2つ入ってしまった(まだ深く気づいていない))→通らない→原因はtherubyracerにあるようなのでgem install therubyracerするとパスが通らない→libv8が2つ入ってしまったことを思い出す→uninstallしてgem install therubyracerして通る←イマココ
このtherubyracerを通すところまでもっていきます。

therubyracerを入れなおそうとすると、extconf.rb failedした。


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

        /usr/local/Cellar/ruby/1.9.3-p125/bin/ruby extconf.rb
checking for main() in -lobjc... yes
*** 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/local/Cellar/ruby/1.9.3-p125/bin/ruby
 --with-objclib
 --without-objclib
extconf.rb:15:in `
': undefined method `include_path' for Libv8:Module (NoMethodError) Gem files will remain installed in /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.1 for inspection. Results logged to /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.1/ext/v8/gem_make.out



vendor/cacheの中を確認しても特に問題はないようだ。
ここでbundle updateしたときにlibv8が二重で入ってしまったことを思い出す。
てことで1つ新しい方をアンインストールします。
$ gem uninstall libv8

Select gem to uninstall:
 1. libv8-3.3.10.4-x86_64-darwin-11
 2. libv8-3.11.8.0
 3. All versions
> 2

お前だったのか。。って感じ。
$ gem install therubyracer

ちゃんと通った。ようやくgit push してheroku masterの称号をえるんだーーー!w
ポケモンマスターにもなりたいーーーーー!
以上です。

ちなみにlibv8 3.3.10.4の入れ方は、
gem install --version '=3.3.10.4' libv8です。