m_shige1979のときどきITブログ

プログラムの勉強をしながら学習したことや経験したことをぼそぼそと書いていきます

Github(変なおっさんの顔でるので気をつけてね)

https://github.com/mshige1979

curlを最新版へソースインストール

ruby関連の勉強を始めてみようとしたけど

なんか出る

/tmp/ruby-build.20181006035131.5059 ~/.rbenv/plugins/ruby-build
curl: (35) Peer reports incompatible or unsupported protocol version.
~

環境

vangrant上のcentos7(64bit)

なんかcurlが古いらしい

$ curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.15.4 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz
$

証明書関連で動かなくなった感じ?

最新をソースコードよりインストールする

yumでツールをインストール
sudo yum install -y openssl-devel libmetalink-devel libssh2-devel c-ares-devel lbzip2
ダウンロード&インストール
wget https://curl.haxx.se/download/curl-7.61.1.tar.gz
tar zxf curl-7.61.1.tar.gz
cd curl-7.61.1
./configure --enable-libcurl-option
make
sudo make install
インストールパスを間違えたので古いやつを削除してリンクにする
sudo rm -f /usr/bin/curl
sudo ln -s /usr/local/bin/curl /usr/bin/curl
確認
$ curl -V
curl 7.61.1 (x86_64-pc-linux-gnu) libcurl/7.61.1 OpenSSL/1.0.2k zlib/1.2.7
Release-Date: 2018-09-05
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
$

rbenvでインストールができるようになった\(^o^)/

[vagrant@localhost ~]$ rbenv install 2.3.7
Downloading ruby-2.3.7.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.7.tar.bz2
Installing ruby-2.3.7...
Installed ruby-2.3.7 to /home/vagrant/.rbenv/versions/2.3.7

[vagrant@localhost ~]$