LoginSignup
2
3

More than 5 years have passed since last update.

plackupできねぇ!

Posted at

cpanmでplackをインストール済みなのにplackupできない現象が発生。なんじゃこりゃ!前はできたのに。

% plackup
zsh: command not found: plackup

そもそもplackupってインストールされているの?

% find . -name plackup
./.cpanm/work/1419639327.83630/Plack-1.0033/blib/script/plackup
./.cpanm/work/1419639327.83630/Plack-1.0033/script/plackup
./.plenv/versions/5.20.1/bin/plackup

plackup自体はインストールされていることが確認できた。
PATHが通ってないのかと思ったらPATHは通っている模様。~/.plenv/shimsディレクトリにPATHが通っているので問題ない。

% echo $PATH 
/Users/ingktds/.mysqlenv/bin:/Users/ingktds/.mysqlenv/shims:/Users/ingktds/.mysqlenv/mysql-build/bin:/Users/ingktds/.rbenv/shims:/usr/local/bin:/usr/local/mysql/bin:/Applications/MacVim.app/Contents/MacOS:/Users/ingktds/.plenv/bin:/Users/ingktds/.plenv/shims:/Users/ingktds/.rbenv/shims:/Users/ingktds/.rbenv/bin:/Users/ingktds/.nodebrew/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

plenvのサイトに説明が載っていた。
以下引用。

Rebuild the shim executables. You should do this any time you install a new Perl executable (for example, when installing a new Perl version, or when installing a cpanm that provides a command).

$ plenv rehash

新しいPerlバージョンをインストール時や新しくCPANモジュールをインストールする時はplenv rehashをする必要があるみたいです。

plenv

plenv rehashした後にplackupしたら問題なく起動することができました。

% plenv rehash
% plackup app.pl 
HTTP::Server::PSGI: Accepting connections at http://0:5000/

plenv rehashでググったらpapixさんの記事が見つかりました。

plenv環境下でcpanmを使ってモジュールを導入した後にrehashを忘れて辛い

同じような現象でハマっていたようですね。シェルスクリプトを利用して強制的にrehashする工夫がされていまいした。追記ではcpanmが実行された際に自動的にrehashされるようになったとの内容がありましたが私のはされないのはなんで?この辺りはもう少し調べる必要がありそうでうす。

2
3
2

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
3