Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gemrc file specification

I searched everywhere to find the .gemrc file specification but I haven't succeed.

Does anyone know where I can find it?

like image 993
Thiago Diniz Avatar asked Nov 27 '10 15:11

Thiago Diniz


People also ask

What is .gemrc file?

gemrc is a YAML file that uses strings to match gem command arguments and symbols to match RubyGems options.

What is Gemname?

GEMNAME - name of the gem to print information about.

How do I check my GEM version?

Since your goal is to verify a gem is installed with the correct version, use gem list . You can limit to the specific gem by using gem list data_mapper . To verify that it's installed and working, you'll have to try to require the gem and then use it in your code.

What is gem install command?

The gem command allows you to interact with RubyGems. Ruby 1.9 and newer ships with RubyGems built-in but you may need to upgrade for bug fixes or new features. To upgrade RubyGems, visit the download page. If you want to see how to require files from a gem, skip ahead to What is a gem. Finding Gems.


2 Answers

gem looks for a configuration file .gemrc in your home directory, although you can specify another file on the command-line if you wish (with the --config-file modifier).

There are three things you can specify in the configuration file:

  • command-line arguments to be used every time gem runs
  • command-line options for ’’RDoc’’ (used when generating documentation)
  • GEM_PATH settings

More at gem environment command doc.

like image 111
lbz Avatar answered Sep 23 '22 08:09

lbz


'Home' is a Linux/Mac term. What is refers to is the folder where a user's settings appear. You can find out where your settings directory is by doing the following:

on Unix/Linux, open a terminal and type the following command:

echo $HOME 

on Windows, open a command-prompt and type the following command:

echo %USERPROFILE% 

For me (in Windows 7), this is C:\Users[name]. However, looks like Ruby doesn't set up your .gemrc in that folder by default. Instead, you have to create the file. Open a text editor, copy the YAML style code you need (documentation), and save the file as .gemrc in your home directory (make sure you select all files, not '.txt').

These settings will only affect that individual user. If it's your personal computer, however, you probably don't need to change the settings for all users.

like image 38
ansorensen Avatar answered Sep 24 '22 08:09

ansorensen