anyenvのインストール

anyenvは様々な言語の環境管理ツールである**envの管理を容易にするツールです。

GitHubリポジトリ

riywo/anyenv: all in one for **env

インストール

$ git clone https://github.com/riywo/anyenv ~/.anyenv
$ echo 'export PATH="~/.anyenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l

使い方

使用可能な**env一覧

$ anyenv install -l
Available **envs:
  Renv
  crenv
  denv
  erlenv
  exenv
  goenv
  hsenv
  jenv
  luaenv
  ndenv
  nenv
  nodenv
  phpenv
  plenv
  pyenv
  rbenv
  sbtenv
  scalaenv
  swiftenv

**envのインストール

例) rbenvのインストール

$ anyenv install rbenv
/var/folders/xy/fnl5h1z53cv0hw63npcbfqtm0000gn/T/rbenv.20180428110848.9737 ~
Cloning https://github.com/rbenv/rbenv.git...
Cloning into 'rbenv'...
remote: Counting objects: 2714, done.
remote: Total 2714 (delta 0), reused 0 (delta 0), pack-reused 2714
Receiving objects: 100% (2714/2714), 506.25 KiB | 158.00 KiB/s, done.
Resolving deltas: 100% (1700/1700), done.
~
~/.anyenv/envs/rbenv/plugins ~
Cloning https://github.com/rbenv/ruby-build.git...
Cloning into 'ruby-build'...
remote: Counting objects: 8846, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 8846 (delta 1), reused 0 (delta 0), pack-reused 8843
Receiving objects: 100% (8846/8846), 1.85 MiB | 356.00 KiB/s, done.
Resolving deltas: 100% (5697/5697), done.
~

Install rbenv succeeded!
Please reload your profile (exec $SHELL -l) or open a new session.
$

rbenvインストール後の確認

$ exec $SHELL -l
$
$ rbenv
rbenv 1.1.1-30-gc8ba27f
Usage: rbenv  []

Some useful rbenv commands are:
   commands    List all available rbenv commands
   local       Set or show the local application-specific Ruby version
   global      Set or show the global Ruby version
   shell       Set or show the shell-specific Ruby version
   install     Install a Ruby version using ruby-build
   uninstall   Uninstall a specific Ruby version
   rehash      Rehash rbenv shims (run this after installing executables)
   version     Show the current Ruby version and its origin
   versions    List all Ruby versions available to rbenv
   which       Display the full path to an executable
   whence      List all Ruby versions that contain the given executable

See `rbenv help ' for information on a specific command.
For full documentation, see: https://github.com/rbenv/rbenv#readme

他の言語も**envも同様の方法でインストール可能です。

現在インストールされている**envの確認方法

$ anyenv versions
phpenv:
* system (set by /Users/xxx/.anyenv/envs/phpenv/version)
pyenv:
* system (set by /Users/xxx/.anyenv/envs/pyenv/version)
  anaconda3-5.0.0
rbenv:
* system (set by /Users/xxx/.anyenv/envs/rbenv/version)

コメント