Skip to content

Instantly share code, notes, and snippets.

@rahul286
Created April 7, 2015 07:15
Show Gist options
  • Save rahul286/7160839f4425a3b7e718 to your computer and use it in GitHub Desktop.
Save rahul286/7160839f4425a3b7e718 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
@jonjitsu
Copy link

The way all cheat sheets should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment