Skip to content

Instantly share code, notes, and snippets.

@masudcsesust04
Last active January 31, 2017 04:29
Show Gist options
  • Save masudcsesust04/a6d4c4113b6ad1707dfe571e7076c567 to your computer and use it in GitHub Desktop.
Save masudcsesust04/a6d4c4113b6ad1707dfe571e7076c567 to your computer and use it in GitHub Desktop.

If you already have RVM then

Remove RVM

$ rvm implode
or 
$ rm -rf ~/.rvm

Note: Also make sure all of the .rvm files and folder are deleted.

Rbenv installation

clone rbenv from git repo

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

Compile dynamic bash extension

$ cd ~/.rbenv && src/configure && make -C src

Add below in .bashrc file

export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
which rbenv > /dev/null && eval "$(rbenv init -)"

Shell-specific instructions on how to initialize rbenv to enable shims and autocompletion.

$ ~/.rbenv/bin/rbenv init

Restart shel then run

$ type rbenv

Installing as an rbenv plugin

$ cd ~/.rbenv/plugins/ruby-build
$ git clone https://github.com/rbenv/ruby-build.git
or 
$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

Installing Ruby versions

List all available versions:

$ rbenv install -l

Install a Ruby version:

$ rbenv install 2.0.0-p247

Rbenv rehasb ruby after installing ruby

$ rbenv rehash

Intall ruby gem

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