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-buildecho 'eval "$(rbenv init -)"' >> ~/.bash_profilerbenv 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 bundlerorgem install cocoapodsrbenv rehash(nowbundlerorcocoapodsor whatever will have a rbenv shim on thePATH)
Finally, if you depend on Postgres (of course you do):
- Install Postgres.app. Add its
/bindirectory to yourPATH 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.