Step by steps:
To create/edit the .gemrc file from the terminal:
vi ~/.gemrc
You will open a editor called vi. paste in:
gem: --no-ri --no-rdoc
click 'esc'-button.
type in:
:exit
You can check if everything is correct with this command:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit ~/.gemrc