Skip to content

Instantly share code, notes, and snippets.

@bvanderveen
Last active September 4, 2016 21:44
Show Gist options
  • Save bvanderveen/0d3212542cf294ceb72b to your computer and use it in GitHub Desktop.
Save bvanderveen/0d3212542cf294ceb72b to your computer and use it in GitHub Desktop.
How I installed Ruby on a clean Mac (August 2015)

First prepare your Mac for Developer Mode™.

  • xcode-select --install (now all sorts of stuff works)
  • Install homebrew

Install rbenv and use it to install a Ruby:

  • brew install rbenv ruby-build
  • echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
  • rbenv install <whatever ruby version>

Now you can install Gems.

If you're a Ruby developer, the first thing you should do is install bundler. If you're an iOS developer, the first thing you probably want to do is install cocoapods.

  • gem install bundler or gem install cocoapods
  • rbenv rehash (now bundler or cocoapods or whatever will have a rbenv shim on the PATH)

Finally, if you depend on Postgres (of course you do):

  • Install Postgres.app. Add its /bin directory to your PATH
  • gem install -v <whatever version your Gemfile[.lock] demands> pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config

Now you can bundle install inside your Rails project.

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