rbenv is a ruby version manager similar to rvm however rbenv works on both Mac & Linux. If you have to learn something - it's nicer to learn something that covers two environments rather than one in case you ever need to use it in a mac/linux environment.
- Install developer libraries from Apple
xcode-select --install
- Install brew
- Install rbenv (Terminal app)
brew install rbenv
- Setup rbenv
rbenv init
- Add rbenv to your ~/.bash_profile NOTE: these will not give you back any feedback to tell you they are complete.
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
- Reopen the terminal and install ruby
rbenv install 2.4.1
- Setup the version of Ruby you wish to use
rbenv local 2.4.1
- Once Ruby has been set to local you should be able to verify which version you have
ruby -v
- Install Ruby On Rails
gem install rails --version 5.1.1 --no-ri --no-rdoc && rbenv rehash
Type rails -v
to test your version
rbenv is a ruby version manager similar to rvm however rbenv works on both Mac & Linux. If you have to learn something - it's nicer to learn something that covers two environments rather than one in case you ever need to use it in a mac/linux environment.
- Install git if you haven't already
- Update your Ubuntu (in your terminal)
sudo apt-get update
- Get some required dependancies
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev nodejs sqlite3 libsqlite3-dev
- Using git - download rbenv git repo to a hidden directory
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
- Add terminal commands for rbenv NOTE: these will not give you back any feedback to tell you they are complete.
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
- Run command for rbenv
source ~/.bashrc
- Check if rbenv works
type rbenv
You should get back a "rbenv is a function" in the terminal
- Install ruby-build to help rbenv using git
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
- Install ruby using rbenv
rbenv install 2.4.1
- Setup the version of Ruby you wish to use
rbenv local 2.4.1
- Once Ruby has been set to local you should be able to verify which version you have
ruby -v
- Install Ruby On Rails
gem install rails --version 5.1.1 --no-ri --no-rdoc && rbenv rehash
Type rails -v
to test your version
- Download and install Ruby 2.4.1-1 (x64)
- You will be given options during the install [1,2,3]. One at a time use all 3 options.
- Once Ruby has been installed you should be able to verify which version you have, open Powershell or cmd and type:
ruby -v
- Install rails using Powershell/CMD
gem install rails
- Type
rails -v
to test your version