Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trying (and failing) to load specific version of gem

104 views
Skip to first unread message

Brian Candler

unread,
Apr 11, 2008, 7:18:48 AM4/11/08
to
I wonder if someone can help with a problem which I'm sure is very simple
and obvious, but I'm tearing my hair out.

I have rubygems 1.0.1 installed. I have two gems of ActiveRecord installed
(1.15.3 and 2.0.2). I simply want a program to run using 1.15.3.

Here are the different ways I've tried to do it, all of which fail with the
exceptions shown:

require 'rubygems'
gem 'activerecord', '=1.15.3'
ActiveRecord # >> uninitialized constant ActiveRecord

require 'rubygems'
gem 'activerecord', '=1.15.3'
require 'activerecord' # >> can't activate activerecord (= 2.0.2), already activated activerecord-1.15.3]

require 'rubygems'
require_gem 'activerecord', '=1.15.3' # >> undefined method require_gem

require 'rubygems'
require 'activerecord', '=1.15.3' # >> wrong number of arguments (2 for 1)

require 'rubygems'
require 'gemconfigure'
Gem.configure([['activerecord','=1.15.3']])
ActiveRecord # >> uninitialized constant ActiveRecord

require 'rubygems'
require 'gemconfigure'
Gem.configure([['activerecord','=1.15.3']])
require 'activerecord' # >> can't activate activerecord (= 2.0.2), already activated activerecord-1.15.3]

I see that rubygems-1.1.0 and 1.1.1 have now been released, but see nothing
in the changelogs which suggest that this was a known or fixed issue.
Equally, this is such core behaviour that it can't be broken, or someone
else would have noticed, so I'm sure I'm simply doing it wrong.

Could someone enlighten me please? I am failing to get it to DWIM :-)

Thanks,

Brian.

Jano Svitok

unread,
Apr 11, 2008, 7:28:54 AM4/11/08
to

Brian Candler

unread,
Apr 11, 2008, 8:04:40 AM4/11/08
to
> http://rubyforge.org/tracker/index.php?func=detail&aid=16739&group_id=126&atid=575

Thanks for the quick response. So the magic incantation is:

require 'rubygems'
gem 'activerecord', '=1.15.3'

require 'active_record'
ActiveRecord # >> works!

Cheers,

Brian.

0 new messages