0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

plenv, cpanm を ZScaler 配下で使う際のメモ

Posted at

はじめに

以前 ZScaler 配下でnpm install ができなかったときの対応方法 のような記事を書きましたが、ちょっと Perl に相当久しぶりに触れる機会があり、その際にこの ZScaler 問題含めて色々覚えたことがあるのでメモ。

plenv のインストール

Pythonに pyenv があるのと同じように、Perl には plenv というものがある。
以下で使えるようになる。

brew install plenv

.zshrc に以下を追記。

eval "$(plenv init -)"

使い方は pyenv とかとほぼ同じ感じなので割愛。

plenv について ZSaler 問題を回避するための方法

ZScaler 配下だと、以下のようなエラーとなり install -l の時点で弾かれる。

% plenv install -l                                                                    
Available versions:
599 Internal Exception, https://fastapi.metacpan.org/v1/release/_search, SSL connection failed for fastapi.metacpan.org: SSL connect attempt failed error:14FFF086:SSL routines:(UNKNOWN)SSL_internal:certificate verify failed

この対策のため、.zshrc に以下を追記する。
ca-bundle.pem は冒頭に書いた以前の記事で作ったもの。

export SSL_CERT_FILE=/path/to/ca-bundle.pem

cpanm のインストール

モジュールをインストールするためのツールとして、Node では npm , yarn があるのと同じで、Perl には cpanm というものがあると知った。
plenv でこれを使用したい場合、ストレートに以下のコマンドが存在する。

plenv install-cpanm

これが終わったら、 cpanm コマンドを使用して、以下のようにモジュールインストールができる。

cpanm JSON

結果こうなる。

plenv list-modules

App::cpanminus
JSON

Perl ほぼ覚えていないので、次やるとき絶対覚えてないと思って記事にしてみました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?