[Rubygems-developers] can 2 Gem directories co-exist?

Jim Freeze rubygems at freeze.org
Fri Feb 3 15:16:37 EST 2006

On 2/3/06, Jim Weirich <jim.weirich at gmail.com> wrote:
> Assuming everything was setup correctly, that should have worked.
> I'll investigate this weekend.

Ok, I have checked again. I had a few path issues, but still no worky.

Here is what I have. First, GEM_HOME lists two directories.

	% env | grep -i gem

First the local gems dir (notice no rake installed):

	% ls /Users/jdf/my_gems
	bin             doc             lib             specifications
	cache           gems            source_cache
	% ls /Users/jdf/my_gems/gems/
	commandline-0.7.10      sources-0.0.1           text-hyphen-1.0.0
	rubygems-update-0.8.11  text-format-1.0.0

Next the native gems dir

	% ls /opt/local/ruby-1.8.4/lib/ruby/gems/1.8/
	cache           doc             gems            source_cache    specifications
	% ls /opt/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/
	RedCloth-3.0.4          actionwebservice-1.0.0  mysql-2.7            
	actionmailer-1.1.5      activerecord-1.13.2     rails-1.0.0          
	actionpack-1.11.2       activesupport-1.2.5     rake-0.7.0

Results with 2 paths in GEM_HOME:

	 % rake --task
`report_activate_error': Could not find RubyGem rake (> 0)
	        from /opt/local/ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems.rb:141:in
	        from /opt/local/ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems.rb:37:in
	        from /opt/local/ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems.rb:31:in
	        from /opt/local/ruby-1.8.4/bin/rake:17

GEM_HOME with native path:

	% setenv GEM_HOME /opt/local/ruby-1.8.4/lib/ruby/gems/1.8/
	% rake --task
	(in /Users/jdf/tmp)
	["demo/chunkybacon.rb", "demo/code.rb", "demo/colornames.rb",
"demo/demo.rb", "demo/gettysburg.rb", "demo/hello.rb",
"demo/individual-i.rb", "demo/pac.rb", "demo/pagenumber.rb",
"demo/qr-language.rb", "demo/qr-library.rb"]

Now, GEM_HOME with local path:

	% setenv GEM_HOME /Users/jdf/my_gems
	% cat app.rb
	require 'rubygems'
	require 'commandline'
	class App < CommandLine::Application
	  def initialize
	    puts "running app"
	end#class App

	% ruby app.rb
	running app

So, a single directory works.

Jim Freeze

More information about the Rubygems-developers mailing list