Where is the default Gem.dir path set?

This is really odd: I installed ruby 1.9.1 using a “191” suffix so that it will coexist with other versions. e.g. the executables look like ruby191, gem191 and the library directory where all of the vendor/site code lives is /usr/local/lib/ruby191. The version of RubyGems (1.3.1) that is included with ruby 1.9.1 works fine. The installation was performed with:

cd /usr/local/src/ruby-1.9.1-p429
./configure --prefix=/usr/local --program-suffix=191
sudo make install

However, when I upgrade my RubyGems installation with sudo gem191 update --system it appears to forget about all of the installed gems. When I checked it out with gem191 environment it is now looking in /usr/local/lib/ruby.

  • Ruby On Rails won't load @content_for_layout
  • How to handle gemset
  • Problems Installing puma ruby gem on OS X El Capitan 10.11
  • What is the cleanest and easiest way to share custom RSpec matchers across multiple ruby/rails projects?
  • Why does my email confirmation display on Google Chrome but not Internet Explorer
  • Bundler, when attempting to update or install, will hang forever
  • I know I can create a ~/.gemrc and change the location there, but that smells like a hack to me. I have spent a couple of hours trying to figure out where Gem.dir is set in the code, but have been unable to find it. Does anyone know where the default location is set?

  • Merb having issues requiring gems
  • How can I get rid of the following warning: Problem while setting context on example startundefined local variable or method `selenium_driver'
  • Ruby:Change UTC time zone to UTC+ or UTC - zone
  • Bundle exec rake test is not producing results
  • running rake fails with Gem::GemNotFoundException ERR
  • Role based security mechanism for attributes in Rails
  • 2 Solutions collect form web for “Where is the default Gem.dir path set?”

    Apparently the Gem engine didn’t work properly under ruby 1.9.1, but has been fixed under ruby 1.9.2. After installing the latest build, all of my Gem issues have disappeared.

    You should definitely use rvm gem for multiple ruby installations on one system.

    P.S. You can view your gem installation path by using $ gem{suffix} env.

    Ruby is the best programming language in the world - Ruby on Rails.