Je pense que beaucoup de gens utilisent rbenv et pyenv, mais au fur et à mesure que vous les installez, le contenu à écrire en .bashrc et .zshrc augmentera progressivement. Avec anyenv, vous n'avez qu'à écrire deux lignes.
.zshrc
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"
C'est pratique. Cette fois, je vais mettre ceci.
$ git clone https://github.com/riywo/anyenv ~/.anyenv
Modifiez .zshrc. Si vous utilisez bash, ce sera .bashrc ou .bash_profile.
.zshrc
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"
#Vous pouvez commenter ce que vous avez écrit jusqu'à présent ↓
# Ruby Env
#export PATH="$HOME/.rbenv/bin:$PATH"
#eval "$(rbenv init -)"
# Python Env
# export PATH=$PYENV_ROOT/bin:$PATH
# eval "$(pyenv init -)"
# eval "$(pyenv virtualenv-init -)"
# Java Env
#export PATH="$HOME/.jenv/bin:$PATH"
#eval "$(jenv init -)"
Redémarrez le shell.
$ exec $SHELL -l
J'essaierai si anyenv peut être utilisé.
$ anyenv
anyenv
Usage: anyenv <command> [<args>]
Some useful anyenv commands are:
   commands            List all available anyenv commands
   local               Show the local application-specific Any version
   global              Show the global Any version
   install             Install a **env
   uninstall           Uninstall a specific **anv
   version             Show the current Any version and its origin
   versions            List all Any versions available to **env
See `anyenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/riywo/anyenv#readme
Oh, il semble que cela puisse déjà être utilisé.
Si vous souhaitez installer un nouveau système d'environnement, vous pouvez facilement l'entrer avec une seule commande. Par exemple, si vous souhaitez inclure ndenv, procédez comme suit:
$ anyenv install ndenv
Avec cela seul, vous pourrez bientôt utiliser ndenv. Pratique ~.
$ ndenv
ndenv 0.4.0-4-ga339097
Usage: ndenv <command> [<args>]
Some useful ndenv commands are:
   commands    List all available ndenv commands
   local       Set or show the local application-specific Node version
   global      Set or show the global Node version
   shell       Set or show the shell-specific Node version
   install     Install a Node version using the node-build plugin
   uninstall   Uninstall a specific Node version
   rehash      Rehash ndenv shims (run this after installing executables)
   version     Show the current Node version and its origin
   versions    List all Node versions available to ndenv
   which       Display the full path to an executable
   whence      List all Node versions that contain the given executable
See `ndenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/riywo/ndenv#readme
Si vous avez déjà quelque chose que vous utilisiez, tel que pyenv ou rbenv, collez-le car il ne sera pas lu sauf si vous collez un lien symbolique.
$ ln -s ~/.rbenv ~/.anyenv/envs/rbenv
$ ln -s ~/.pyenv ~/.anyenv/envs/pyenv
$ ln -s ~/.jenv ~/.anyenv/envs/jenv
C'était facile. la fin.
J'ai fait référence à cet article. http://qiita.com/luckypool/items/f1e756e9d3e9786ad9ea http://d.hatena.ne.jp/riocampos+tech/20141019/install_anyenv