git-core libssl-dev libreadline-dev zlib1g-dev bison build-essential libyaml-dev
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
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
Install the desired Ruby version
Create a Gemset for your project
Now bundle install
won't ask for your (sudo) password anymore.