プログラミング的なSomething

プログラミング的なSomething

ITエンジニア(?)目線で生活・自転車・トレーニング話を綴ります

mavericksにupdateしてからはじめてrbenvでRubyをinstallしたらエラーが出た

エラー出たのでまとめ。

 

  • rvm install 1.9.3 => Error while running configure. Halting the installation.

https://github.com/wayneeseguin/rvm/issues/2331

読むとどうもmavericksの既知のバグらしい。

 

http://stackoverflow.com/questions/19727392/installation-of-ruby-1-9-3-in-mac-os-mavericks

 ここの最後のコメントに「既知だぜ!」ってコメントがあった。rbenv使ってるけどmavericks固有の問題なら試してみる価値ありますね。

 

  • 対応

unset CC

rbenv install <任意のruby version>

 

echo $$CCの結果は gcc-4.2 でした。

 

 

再度エラーが発生する。

検索したらまさに以下のリンク先の問題にドンピシャ。

  • The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

https://github.com/sstephenson/ruby-build/issues/377

 

エラーメッセージは末尾がタイトル通りのものがでました。

 

  • 対応その2

brew update

RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1e rbenv install 2.0.0-p195

 

  • 解決

yonetin:study yonetin$ rbenv versions

  system

  1.8.7-p371

* 1.9.3-p429 (set by /Users/yonetin/.rbenv/version)

  2.0.0-p195

 

やったね!