rbenv で ruby 2.3.1 をインストールしようとしたらエラーになった
% rbenv install 2.3.1
Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
error: failed to download ruby-2.3.1.tar.bz2
BUILD FAILED (OS X 10.10.5 using ruby-build 20160426-33-g3304f96)
Inspect or clean up the working tree at /var/folders/01/f7zbq8wn5xdbn4r4x0r_541h0000gn/T/ruby-build.20160610095331.2317
Results logged to /var/folders/01/f7zbq8wn5xdbn4r4x0r_541h0000gn/T/ruby-build.20160610095331.2317.log
Last 10 log lines:
/var/folders/01/f7zbq8wn5xdbn4r4x0r_541h0000gn/T/ruby-build.20160610095331.2317 /var/folders
curl: (56) SSLRead() return error -9806
curlでエラーになってるみたい
curl を brew でインストール
% brew install curl
==> Downloading https://homebrew.bintray.com/bottles/curl-7.49.0.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring curl-7.49.0.yosemite.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/curl/lib
CPPFLAGS: -I/usr/local/opt/curl/include
==> Summary
🍺 /usr/local/Cellar/curl/7.49.0: 364 files, 2.5M
curl のバージョンを比較してみた
% /usr/bin/curl --version
curl 7.43.0 (x86_64-apple-darwin14.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets
% /usr/local/opt/curl/bin/curl --version
curl 7.49.0 (x86_64-apple-darwin14.5.0) libcurl/7.49.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
バージョンが違う・・・
リンク先を変更する
% sudo mv /usr/bin/curl /usr/bin/curl_
% sudo ln -s /usr/local/opt/curl/bin/curl /usr/bin/curl
再度インストール
% rbenv install 2.3.1
Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
Installing ruby-2.3.1...
Installed ruby-2.3.1 to /Users/ansapo/.rbenv/versions/2.3.1
わ~い