Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rbenv ubuntu server cheatsheet
## ubuntu server with bash shell
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
## verify
type rbenv
#=> "rbenv is a function"
## list all available versions:
rbenv install -l
## install a Ruby version:
rbenv install 2.2.1
## uninstall a Ruby version:
rbenv uninstall 2.2.1
## Set application specific version number (written in `.ruby-version`)
rbenv local 2.2.2
## Unset application specific version number
rbenv local --unset
## Set global version number for a user (written in `~/.rbenv/version`)
rbenv global 2.2.2
## Unset application specific version number
rbenv global --unset
## System version of ruby
The special version name system tells rbenv to use the system Ruby
## Set shell-specific version number
rbenv shell 2.2.2
## Unset application specific version number
rbenv shell --unset
## Installed versions
rbenv versions
## Current version
rbenv version
## ruby installed or gem installed which provides commands
rbenv rehash
## display path to ruby executable
rbenv which
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment