Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install rbenv in CentOS 7
# install build dependencies
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
# clone and install rbenv environment
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
# re-init bash
source ~/.bash_profile
# install latest ruby
rbenv install -v 2.2.2
# sets the default ruby version that the shell will use
rbenv global 2.2.2
# to disable generating of documents as that would take so much time
echo "gem: --no-document" > ~/.gemrc
# install bundler
gem install bundler
# must be executed everytime a gem has been installed in order for the ruby executable to run
rbenv rehash
@dctremblay

This comment has been minimized.

Copy link

dctremblay commented Aug 18, 2017

Thanks a lot my dude, very useful Gist

@Francoois

This comment has been minimized.

Copy link

Francoois commented Jan 20, 2018

Yes thank you a lot ! <3

@daverogers

This comment has been minimized.

Copy link

daverogers commented May 16, 2018

rbenv rehash is depreciated as it's now part of the core.

@shal

This comment has been minimized.

Copy link

shal commented Sep 22, 2018

Thanks @soardex, it was very useful!

@kirkog86

This comment has been minimized.

Copy link

kirkog86 commented Jan 26, 2020

This is great! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.