- Open the Terminal app
- Install rbenv using homebrew with
brew install rbenv
- Install ruby-build using homebrew with
brew install ruby-build
- Copy and paste following code into your terminal window:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
and hit return. - Copy and paste following code into your terminal window:
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
and hit return. - Close your terminal window and open a new one.
- Type in
rbenv install 2.4.2
and hit return. - Ruby is now installing, this might take a while.
- After the installation is finished type in
rbenv global 2.4.2
- Type in
rbenv versions
and check if you get something like this:* 2.4.2 (set by /Users/rodrigo/.rbenv/version)
- Open the bash terminal
- Type in
sudo apt install ruby
and follow the instructions on screen. - Type in
sudo apt install git
and follow the instructions on screen. - Copy and paste following code into your terminal window:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
and hit return. - copy and paste following code into your terminal window:
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
and hit return. - Copy and paste following code into your terminal window:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
and hit return. - Copy and paste following code into your terminal window:
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
and hit return. - Close your termial and open a new one.
- Type in
sudo apt install build-essential
and follow the instructions on screen. - Type in
rbenv install 2.4.2
and hit return. - Ruby is now installing, this might take a while.
- After the installation is finished type in
rbenv global 2.4.2
- Type in
rbenv versions
and check if you get something like this:* 2.4.2 (set by /Users/rodrigo/.rbenv/version)