I won't explain here what is a version manager good for assuming that if you're reading this note, you already have a good idea about. If you're wondering about why should your ever use a software like this with the language of your choice, you can find some info in the RVM documentation for example.
I've used to use different version managers for different languages I was using for my work and/or own purpouses: rbenv and rvm for Ruby, nvm for node, pvers for PHP, kiex for Elixir, kerl for Erlang etc. The disadvantage of this approach is clearly evident: a ton of different software with custom dotfiles, commands, flags and so on. Every program for managing language versions should be installed manually and the documentation should been readen every time before you can start using it.
So. The asdf manager is a silver bullet you've been looking for. It allows you to rule all the languages with using a single manager. Currently Ruby, Node, Elixir, Erlang, PHP and many other languages are supported.
Download the latest software.
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.3.0
Update your shell config.
echo -e '\n[ -f $HOME/.asdf/asdf.sh ] && \. $HOME/.asdf/asdf.sh' >> ~/.zshrc echo -e '[ -f $HOME/.asdf/completions/asdf.bash ] && \. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc chmod +x $HOME/.asdf/asdf.sh chmod +x $HOME/.asdf/completions/asdf.bash
Install a plugin for ruby support.
asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
Check that plugin was successfully installed:
asdf plugin-list ruby
Let asdf understand your .ruby-version files:
echo 'legacy_version_file = yes' >> ~/.asdfrc
Move ruby installs from rbenv directory.
mkdir ~/.asdf/installs/ mv ~/.rbenv/versions ~/.asdf/installs/ruby/
To disable rbenv simply comment out those lines in your shell startup:
# export PATH="$HOME/.rbenv/bin:$PATH" # eval "$(rbenv init -)"
Reload your shell or run the
source ~/.youshellrc command.
Enable any other languages listed in HERE.