Skip to content

Instantly share code, notes, and snippets.

@mmichler
Last active March 21, 2017 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmichler/f565b53ca2c94fc437dd782b895c97a0 to your computer and use it in GitHub Desktop.
Save mmichler/f565b53ca2c94fc437dd782b895c97a0 to your computer and use it in GitHub Desktop.
Debian: Install rbenv plus plugins to handle gemsets and gem installation via bundler without needing root access

Prerequisites

git-core libssl-dev libreadline-dev zlib1g-dev bison build-essential libyaml-dev

rbenv Installation

see also https://github.com/rbenv/rbenv#basic-github-checkout

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

Add these lines to your ~/.bashrc

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

Reload your bashrc

. ~/.bashrc

Plugin Installation

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
git clone git://github.com/jf/rbenv-gemset.git ~/.rbenv/plugins/rbenv-gemset
git clone -- https://github.com/carsomyr/rbenv-bundler.git ~/.rbenv/plugins/rbenv-bundler
rbenv bundler on

Usage

Install the desired Ruby version

Create a Gemset for your project

Now bundle install won't ask for your (sudo) password anymore.

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