From: David Naseby Date: 2004-11-17T07:12:57+09:00 Subject: Require errors for rubygems When I have multiple versions of a library in Rubygems, a normal require will fail to pick up the latest version, and I have to do a require_gem to use the library at all. Require works perfectly if there is only one version of the gem installed. I'm on ruby mswin32-1.8.2, with rubygems 0.8.1. For example: >gem list -l activerecord *** LOCAL GEMS *** activerecord (1.0.0, 0.9.5, 0.9.4, 0.9.2, 0.8.1, 0.8.0, 0.7.5) Implements the ActiveRecord pattern for ORM. >gem list -l flexmock *** LOCAL GEMS *** flexmock (0.0.3) Simple and Flexible Mock Objects for Testing irb(main):001:0> require 'flexmock' LoadError: No such file to load -- flexmock from (irb):1:in `require' from (irb):1 irb(main):002:0> require 'activerecord' LoadError: No such file to load -- activerecord from (irb):2:in `require' from (irb):2 irb(main):003:0> #ok, because I haven't required Rubygems, then: irb(main):004:0* require 'rubygems' => true irb(main):005:0> require 'flexmock' => true irb(main):006:0> require 'activerecord' LoadError: No such file to load -- activerecord from c:/languages/ruby/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager. rb:5:in `require__' from c:/languages/ruby/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager. rb:5:in `require' from (irb):6 irb(main):007:0> require_gem 'activerecord' => true -- David Naseby http://homepages.ihug.com.au/~naseby/