Paul
Paul

Reputation: 2728

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
make
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.

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?

Upvotes: 1

Views: 2742

Answers (2)

Paul
Paul

Reputation: 2728

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.

Upvotes: 1

Eimantas
Eimantas

Reputation: 49344

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.

Upvotes: 0

Related Questions