Version Management for Ruby, Python, Node and Rust


Here's a handy cheat sheet if you find yourself needing an exotic version of Ruby, Python, Node or Rust. Other version management tools are available for ruby, python and node, I just happen to like these ones.

ActionRubyPythonNodeRust
List available versions to installrbenv install --listpyenv install --listnvm ls-remoten/a
Install specific versionrbenv install 2.5.1pyenv install 3.6.6nvm install v10.9.0rustup use nightly-2018-08-01
List locally installed versionsrbenv versionspyenv versionsnvm lsrustup show
Pin a project to a versionrbenv local 2.5.1pyenv local 3.6.6echo v10.9.0 > .nvmrc ; nvm userustup override nightly-2018-08-01
Set global versionrbenv global 2.5.1pyenv global 3.6.6n/arustup default nightly-2018-08-01

Python virtual environments

This assumes you've pinned your project to a specific version of python.

# create an virtual environment
pyenv virtualenv thingy
# activate!
pyenv activate thingy
# do your thang!
pip install pylint black pytest
# exit virtual environment
pyenv deactivate

Rust components (standard libraries, RLS, clippy)

Components will install for the active toolchain (stable, nightly, beta)

To install RLS: rustup component add rls-preview rust-analysis rust-src

To install clippy: rustup component add clippy-preview

Rust docs

Did you know you always get an off-line copy of the Rust documentation (language reference, standard library and the Rust book) suite when you install a toolchain? To open it for the active toolchain: rustup doc



Tweet