Ruby 1.8.6 and Rubygems 1.0.1 – “can’t activate xxx, already activated yyy’
Using ruby 1.8.6 and rubygems 1.0.1
If you get the error “can’t activate xxx, already activated yyy”, it can be hard to find the problem.
This version of custom_require.rb has some debug information that prints to the console to make this job easier.
This file updates the file of the same name in the directory
$RUBY_LIB_INSTALL_DIR/site_ruby/1.8/rubygems/custom_require.rb
where $RUBY_LIB_INSTALL_DIR is the base directory where internal Ruby libraries are stored for your particular installation. This is almost always either /usr/lib/ruby or /usr/local/lib/ruby.
In addition, in the following in the file:
$RUBY_LIB_INSTALL_DIR/site_ruby/1.8/rubygems.rb
Add an additional line so the code starting near line 12 looks like this fragment
module Gem
class LoadError < ::LoadError
attr_accessor :name, :version_requirement
end
DEBUG_ME = true unless defined?(Gem::DEBUG_ME)
end
Then, insert a statement similar to this at the start of the method ‘activate’ (near line 300).
puts "rubylib.rubygems activate gem #{gem.inspect} autorequire #{autorequire.inspect} version_requirements #{version_requirements.inspect}" if Gem::DEBUG_ME