I searched everywhere to find the .gemrc
file specification but I haven't succeed.
Does anyone know where I can find it?
gemrc is a YAML file that uses strings to match gem command arguments and symbols to match RubyGems options.
GEMNAME - name of the gem to print information about.
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.
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.
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:
GEM_PATH
settingsMore at gem environment command doc.
'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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With