LoginSignup
4
4

More than 5 years have passed since last update.

Perl セットアップの冪等な自動化

Last updated at Posted at 2014-06-17

Perl 環境の整備は plenv で。想定は OS X 環境。予め Homebrew で perl-build をインストールしておく。

CWD=$(pwd)

if ! which plenv &> /dev/null
then
    PLENV="${HOME}/.plenv"

    if [ ! -d ${PLENV} ]
    then
        git clone git://github.com/tokuhirom/plenv.git ${PLENV}
    else
        cd ${PLENV}
        git pull
        cd ${CWD}
    fi

    export PATH="${PLENV}/bin:${PATH}"
    eval "$(plenv init -)"

    unset PLENV
fi

if ! plenv versions | grep 5.21.0 &> /dev/null
then
    plenv install 5.21.0
fi

plenv global 5.21.0
plenv rehash

unset CWD

インストール後 ${HOME}/.bash_profile とかに下記行を追記の事:

export PATH="${HOME}/.plenv/bin:${PATH}"
eval "$(plenv init -)"
[ -f "${HOME}/.plenv/completions/plenv.bash" ] && source "${HOME}/.plenv/completions/plenv.bash"
4
4
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
4
4