Skip to content

Instantly share code, notes, and snippets.

@mbijon
Forked from rahul286/rbenv-ubuntu.sh
Created February 7, 2020 01:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbijon/2bb667efccdc5b87ba666d5d0a5017bb to your computer and use it in GitHub Desktop.
Save mbijon/2bb667efccdc5b87ba666d5d0a5017bb to your computer and use it in GitHub Desktop.
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