Subscribed unsubscribe Subscribe Subscribe

oinume journal

Scratchpad of what I learned

MacのrbenvでRuby 1.9.3-p392インストール時にopenssl関連のエラー

Ruby

MacのLionで

$ rbenv install 1.9.3-p392

するとこんな感じのエラーが出てきてビルドできなかった。

BUILD FAILED

Inspect or clean up the working tree at /var/folders/7k/6qhgc57n3nj7qbd_h2xpd1cm0000gn/T/ruby-build.20130720093657.99813
Results logged to /var/folders/7k/6qhgc57n3nj7qbd_h2xpd1cm0000gn/T/ruby-build.20130720093657.99813.log

Last 10 log lines:
ossl_x509store.c: In function ‘ossl_x509stctx_set_flags’:
ossl_x509store.c:520: warning: ‘X509_STORE_CTX_set_flags’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:464)
ossl_x509store.c: In function ‘ossl_x509stctx_set_purpose’:
ossl_x509store.c:532: warning: ‘X509_STORE_CTX_set_purpose’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:460)
ossl_x509store.c: In function ‘ossl_x509stctx_set_trust’:
ossl_x509store.c:544: warning: ‘X509_STORE_CTX_set_trust’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:461)
ossl_x509store.c: In function ‘ossl_x509stctx_set_time’:
ossl_x509store.c:561: warning: ‘X509_STORE_CTX_set_time’ is deprecated (declared at /usr/include/openssl/x509_vfy.h:466)
linking shared-object openssl.bundle
make: *** [build-ext] Error 2

いろいろ調べた結果、brew で readline と openssl をインストールして、そのインストール先のディレクトリをrbenvに渡してやればいいらしい。

$ brew install readline openssl
$ export CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`"
$ rbenv install 1.9.3-p392

メタプログラミングRuby

メタプログラミングRuby