Take the 2-minute tour ×

I just finished install Xcode, Homebrew, git, RVM and Ruby on a brand new MacBook Pro machine (following this guide). Next thing I wanted to do is install Rails (following this guide) but cat ~/.gemrc only gives me a "No such file or directory". Any ideas on what I may haven't done properly? Is there a way I can create this file manually - and is such a thing advised or not?


gem environment

gives this output

RubyGems Environment:
- RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [x86_64-darwin12.2.0]
- INSTALLATION DIRECTORY: /Users/sebkomianos/.rvm/gems/ruby-1.9.3-p327
- RUBY EXECUTABLE: /Users/sebkomianos/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
- EXECUTABLE DIRECTORY: /Users/sebkomianos/.rvm/gems/ruby-1.9.3-p327/bin
  - ruby
  - x86_64-darwin-12
   - /Users/sebkomianos/.rvm/gems/ruby-1.9.3-p327
   - /Users/sebkomianos/.rvm/gems/ruby-1.9.3-p327@global
   - :update_sources => true
   - :verbose => true
   - :benchmark => false
   - :backtrace => false
   - :bulk_threshold => 1000
   - http://rubygems.org/

So I guess the configuration file exists somewhere and I only need to add

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri

to it so I avoid the rdoc and ri on every gem installation.

share|improve this question
add comment

5 Answers

up vote 6 down vote accepted

copy-paste the following command:

$ echo "gem: --no-rdoc --no-ri" >> ~/.gemrc

This will do what you are trying to do

share|improve this answer
add comment

There is no ~/.gemrc because you haven't modified any default yet.

If you for example add the RubyGems source with this command:

gem source -a https://rubygems.org

You will find the ~/.gemrc file automatically created.

share|improve this answer
add comment

you have to generate this file by yourself: All "~/.*rc " files are user generated. Their purpose is to place a configuration in them which fit you special needs. They are used at first place before any standard configuration files

share|improve this answer
add comment

Check /etc/gemrc, it could also be there.

Any changes you make to your local ~/.gemrc will take precidence

share|improve this answer
add comment

I think you'll want to add the two lines, install:... and update:... to a file called .gemrc in your user home directory. If the .gemrc file doesn't exist, create it.

share|improve this answer
haha -- we're all trolling for quick and easy answers. Three answers in 2 minutes, all saying the same thing. –  Tom Harrison Jr Nov 19 '12 at 20:38
add comment

Your Answer


