さくらVPS 設定メモ2
debianに最初からあるPerlは5.10.1とかなので、最近のPerlインストールするとこまで。
perlbrewでインストールしようとしたらテストがコケて、うまく入らず、plenvはうまくいった。
@HIROCASTERさんのブログが大変参考になりました。
$ sudo aptitude install curl $ curl -kL http://install.perlbrew.pl | bash $ echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc $ source ~/.bashrc perlbrewにパスが通ればおk $ perlbrew available perl-5.17.9 perl-5.16.2 perl-5.14.3 perl-5.12.5 perl-5.10.1 perl-5.8.9 perl-5.6.2 perl5.005_04 perl5.004_05 perl5.003_07 沢山ありますね。。 Perlはバージョン数の2桁目というか小数点第2位というかが偶数の奴が安定版らしいです よって5.16.2をインストール。 $ perlbrew install perl-5.16.2 Fetching perl 5.16.2 as /home/takumi/perl5/perlbrew/dists/perl-5.16.2.tar.bz2 tar (child): bzip2: Cannot exec: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now Failed to extract /home/takumi/perl5/perlbrew/dists/perl-5.16.2.tar.bz2 at /loader/0x256d5a8/App/perlbrew.pm line 14. おぅ、なんかbzip2がないって怒られてます $ sudo aptitude install bzip2 $ perlbrew install perl-5.16.2 Installing /home/takumi/perl5/perlbrew/build/perl-5.16.2 into ~/perl5/perlbrew/perls/perl-5.16.2 This could take a while. You can run the following command on another shell to track the status: tail -f ~/perl5/perlbrew/build.perl-5.16.2.log Installation process failed. To spot any issues, check /home/takumi/perl5/perlbrew/build.perl-5.16.2.log If some perl tests failed and you still want install this distribution anyway, do: (cd /home/takumi/perl5/perlbrew/build/perl-5.16.2; make install) You might also want to try upgrading patchperl before trying again: perlbrew install-patchperl Generally, if you need to install a perl distribution known to have minor test failures, do one of these command to avoid seeing this message perlbrew --notest install perl-5.16.2 perlbrew --force install perl-5.16.2
うーん、うまくいかんかったらしい、ログ見て原因チェックしてね、無理やりいれたければこのコマンドで〜的な
$ tail -f ~/perl5/perlbrew/build.perl-5.16.2.log I don't see nm out there, either. nroff is in /usr/bin/nroff. perl is in /usr/bin/perl. pg is in /usr/bin/pg. test is in /usr/bin/test. uname is in /bin/uname. I don't see zip out there, either. Substituting less -R for less. I can't find make or gmake, and my life depends on it. Go find a public domain implementation or fix your PATH setting!
うーんと、makeかgmakeが欲しいらしい
$ sudo aptitude install make 再びダメ、再度ログを見る Use which C compiler? [cc] ./trygcc: 67: cc: not found Uh-oh, the C compiler 'cc' doesn't seem to be working. ./trygcc: 67: gcc: Permission denied ./checkcc: 26: cc: not found Uh-oh, the C compiler 'cc' doesn't seem to be working. You need to find a working C compiler. Either (purchase and) install the C compiler supplied by your OS vendor, or for a free C compiler try http://gcc.gnu.org/ I cannot continue any further, aborting.
ccがないのが原因か・・gccで
$ sudo aptitude install gcc $ perlbrew install perl-5.16.2 三度トライ 今度はエラー的なメッセージは出ず Installing /home/takumi/perl5/perlbrew/build/perl-5.16.2 into ~/perl5/perlbrew/perls/perl-5.16.2 This could take a while. You can run the following command on another shell to track the status: tail -f ~/perl5/perlbrew/build.perl-5.16.2.log ログを見ながらゆっくりしていってね!(意訳) 失敗、、テストがコケてる〜? ここで、先日@HIROCASTERさんのブログで読んだplenvというものがあることを思い出す。 そっちでいけるならそれでいいやってことで〜 $ sudo aptitude install git $ git clone git://github.com/tokuhirom/plenv.git ~/.plenv .bashrcなどにパスを通す export PATH="$HOME/.plenv/bin:$PATH" eval "$(plenv init -)" plenv available perl-5.17.9 perl-5.16.2 perl-5.14.3 perl-5.12.5 perl-5.10.1 perl-5.8.9 perl-5.6.2 perl5.005_04 perl5.004_05 perl5.003_07 $ plenv install 5.16.2 -Dusethreads スレッドモードで5.16.2をインストール $ plenv global 5.16.2 $ perl -v 無事5.16.2環境になりました :) $ plenv install-cpanm cpanm導入に専用コマンドがあるらしい $ plenv exec cpanm carton みたいに使うらしい(ショートカット作ると楽かも
とりあえずここまで。