Trying (and failing) to load specific version of gem

B

Brian Candler

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

Jano Svitok

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.

http://rubyforge.org/tracker/index.php?func=detail&aid=16739&group_id=126&atid=575
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top