LoginSignup
6
2

More than 5 years have passed since last update.

rbenvインストール時に Peer reports incompatible or unsupported protocol version. がエラーが出力されたときの対処法

Posted at

概要

今回の投稿では、rbenvインストール時の rbenv install コマンド実行時に BUILD FAILED が出力されてしまい躓いたときに対応した方法をまとめていきます。

1. エラーログの確認

まず、rbenvインストール時に /tmp/ruby-build.xxxx ファイルが生成されるので、そこに出力されているエラーログを確認します。

$ cat /tmp/ruby-build.20180203142646.3916.log
/tmp/ruby-build.20180203142646.3916 ~
curl: (35) Peer reports incompatible or unsupported protocol version.

2. 最新版のcurlをソースインストール

curl: (35) Peer reports incompatible or unsupported protocol version. エラーの対処法を調査したところ curl コマンドのバージョンが古いことが原因で発生している問題であることが判明したため、こちらの投稿を参考に curlのバージョンアップを行います。
具体的に実行したコマンドは以下の通りです。

curlをソースインストール
$ cd /usr/local/src/
$ wget https://curl.mirror.anstey.ca/curl-7.58.0.tar.bz2
$ sudo tar xf curl-7.58.0.tar.bz2
$ cd curl-7.58.0
$ sudo ./configure --enable-libcurl-option
$ sudo make
$ sudo make install

以下の通り、2018/02/03 時点で最新の curlバージョンをインストールしていることを確認します。

curlバージョン確認
$ curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.0.2k zlib/1.2.7
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets HTTPS-proxy

3. rbenv install を実行

再度 rbenv install コマンドを実行し、問題なく rubyがインストールされていることを確認して作業完了です。

$ rbenv install 2.5.0
$ rbenv versions
  2.5.0
$ rbenv global 2.5.0
$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]

参考文献

  1. rbenvでrubyを追加しようとしたら Peer reports incompatible or unsupported protocol version. - 東京伊勢海老通信, https://altarf.net/computer/ruby/3925, Online; accessed 3-February-2018.
  2. How to install curl 7.37.0 with CentOS 6.5 - Qiita, https://qiita.com/maangie/items/4af8b813ed9ddce4a0db, Online; accessed 3-February-2018.
6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2