I have both Rails 2.3.4 and Rails 3.0.0.beta installed on my local machine. I am using ActiveRecord in a stand alone ruby script and when I do require 'active_record'
3.0.0.beta is loaded. How can I force it to require 2.3.4 instead? (without uninstalling 3.0.0.beta)
views:
55answers:
2
+6
A:
This is covered in the RubyGems manual @ http://docs.rubygems.org/read/chapter/4
do:
require 'rubygems'
gem 'activerecord', '= 2.3.4'
Lee
2010-03-13 08:32:48
A:
A little trick is require 'activerecord' when you want 2.3.5 and 'active_record' when you want 3.0.0.beta.
You have a warning when you using activerecord require but it's load only 2.3.5.
After if you want manage several gem in same computer, you can try rvm and gemset system. It's really great.
shingara
2010-03-13 10:47:46
Works great. Thank you!
magnushjelm
2010-03-13 11:13:06
This is definitely a hacky way to do it. The "right" way to do it is covered in the answer by Lee...
severin
2010-03-15 17:00:49
but need Rubygems. fix rubygems like that is not a good way too in all the time.
shingara
2010-03-15 17:18:24