Skip to content

Instantly share code, notes, and snippets.

@FireBall1725
Created January 9, 2019 18:28
Show Gist options
  • Select an option

  • Save FireBall1725/4f240d0d5f80638adaee8b43951b2128 to your computer and use it in GitHub Desktop.

Select an option

Save FireBall1725/4f240d0d5f80638adaee8b43951b2128 to your computer and use it in GitHub Desktop.
Using ruby on mac

Installing Ruby on mac

Install rbenv from brew

$ brew install rbenv

Verify rbenv is setup correctly

$ which ruby
/Users/<username>/.rbenv/shims/ruby

$ which gem
/Users/<username>/.rbenv/shims/gem

Update your .zshrc or .bashrc

# Ruby
eval "$(rbenv init -)"

Download a newer version of ruby

Mac comes with an older version of ruby, at the time of this document 2.6.0 is the latest ruby that has been released

$ rbenv install 2.6.0

Set ruby to use the newer version

$ rbenv shell 2.6.0

Completed

Now you can install gems, install newer versions of ruby, and switch versions of ruby as needed without messing with the apple permissions for the mac installed ruby

Misc Ruby commands

Update gems

$ gem update --system

Install rspec

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