Skip to content

Simple Ruby Version Management (rbenv)

tulhera edited this page Sep 9, 2014 · 7 revisions

source: http://wiki.debian.org/Ruby

System requisites

Before installing rbenv, run the command below to install the dependencies.

# aptitude install curl build-essential libssl-dev libreadline6 libreadline6-dev zlib1g-dev zlib1g libpq-dev libsqlite3-dev libmagickwand-dev libqtwebkit-dev git libqt4-dev libreadline-dev libxslt-dev

Installing rbenv on Debian 7 (wheezy)

Downloading and configuring rbenv

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc

Installing ruby-build

$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ cd ~/.rbenv/plugins/ruby-build
# ./install.sh

Log-off the root account and continue the installation as the single user used before.

$ rbenv install -l

usage: rbenv install VERSION

  rbenv install /path/to/definition

Available versions:

...

...

2.0.0-dev

2.0.0-p0

2.0.0-p195

2.0.0-preview1

2.0.0-preview2

2.0.0-rc1

2.0.0-rc2

2.1.0

...

...

$ rbenv install 2.1.2
$ rbenv global 2.1.2
$ ruby -v

ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

Remove old RVM installation [Optional]

$ rm -rf ~/.rvm

Troubleshooting

Use "bundle exec" if you didn't succeed to run rails directly

bundle exec rails

Clone this wiki locally