LoginSignup
2
2

More than 5 years have passed since last update.

plenv install-cpanm でエラー

Posted at

plenv install-cpanm を実行すると、以下の様なエラーが出る環境があった。

$ plenv install-cpanm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   303    0   303    0     0   2648      0 --:--:-- --:--:-- --:--:--  2657
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100   226  100   226    0     0    198      0  0:00:01  0:00:01 --:--:--   198
Bareword found where operator expected at - line 3, near "400 Bad"
        (Missing operator before Bad?)
Bareword found where operator expected at - line 6, near "<p>Your"
        (Missing operator before Your?)
syntax error at - line 2, near "html>"
Execution of - aborted due to compilation errors.

install-cpanm内部で使っているcurlコマンドが怪しいということで、
curlコマンドのバージョンを調べた。

$ curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
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

バージョンに関係なく、SSL通信にNSSが使われているのが問題そうなので、
OpennSSLに切り替えた。

ただ、yumでなんとかOpenSSLに切替えようとしたが、
やり方が分からなかったので、以下の手順でコンパイルした。

# cd /usr/local/src
# wget http://curl.haxx.se/download/curl-7.36.0.tar.gz
# tar xvzf curl-7.36.0.tar.gz
# cd curl-7.36.0
# ./configure --prefix=/usr/local --with-openssl
# make && make install
# mv /usr/bin/curl /usr/bin/curl.old

予想通りOpenSSLを使用したcurlではうまく行った。
うまく行ったcurlのバージョンは以下のとおり。

$ curl --version
curl 7.36.0 (x86_64-unknown-linux-gnu) libcurl/7.36.0 OpenSSL/1.0.1e zlib/1.2.3 libidn/1.18
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz

ひとまず問題なくなったが、Chefでyumインストールしている部分なので、
確実にOpenSSLを使用するcurlをyumでインストールしたい。

けど、やり方はまだわかっていない。

2
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
2
2