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
orgem install cocoapods
rbenv rehash
(nowbundler
orcocoapods
or whatever will have a rbenv shim on thePATH
)
Finally, if you depend on Postgres (of course you do):
- Install Postgres.app. Add its
/bin
directory 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.