Skip to content

Instantly share code, notes, and snippets.

@alexcalaca
Last active May 17, 2018 12:48
Show Gist options
  • Save alexcalaca/92dfe6fb99477a375e2eb250a747e1f1 to your computer and use it in GitHub Desktop.
Save alexcalaca/92dfe6fb99477a375e2eb250a747e1f1 to your computer and use it in GitHub Desktop.
How to install rbenv on Cloud9

My profile: https://about.me/alexandrecalaca

1. Update your system

sudo apt-get update

2. Install build-essential

sudo apt-get install -y build-essential

3. Install rbenv

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv

4. Install ruby-build

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

**5. Add to ~/.bash_"

$ echo 'export PATH="~/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc

**6. **

shopt -s expand_aliases
source ~/.bashrc

7. Verify rbenv installation

type rbenv

You should get a message saying that rbenv is a function
8.Verify rbenv versions

rbenv versions

9. Verify current ruby version

ruby -v

10.Install another ruby version

rbenv install 2.5.0

11. Verify all rbenv install versions

rbenv versions 

12.Set a new local version

rbenv local 2.5.0

If you get a permission error, close and reopen your terminal and workspace.

**13. Finally, check your current rbenv version"

rbenv version	

14. Way to go!

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