I
Ian Whitney
I'm setting up a Ruby project on a new development machine and have run into
some trouble getting my unit tests to run. Can any one suggest what the
vital difference between these two machines might be, or what is causing the
error?
Esentially, my problem is that even though I have installed the ActiveRecord
gem, I am unable to use it in a script.
Old development machine where everything works:
Ruby 1.8.4
Gems 0.8.11
ActiveRecord gem installed 1.15.2
Results of IRB session on the old development machine
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require_gem 'activerecord'
=> true
irb(main):003:0> ActiveRecord
=> ActiveRecord
Ok, so that looks good. I can require the gem & then IRB knows what
ActiveRecord is. Great.
New development machine where this doesn't work
Ruby 1.8.6
Gems 0.9.4
ActiveRecord gem installed 1.15.3
Results of IRB session on the new development machine
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'activerecord'
=> true
irb(main):003:0> ActiveRecord
NameError: uninitialized constant ActiveRecord
from (irb):3
So, something is up. In line 2 I'm using the command newer command 'gem'
instead of the depreciated 'require_gem'. But I get the same result even if
I use the depreciated command.
Any ideas? Something I forgot to install on this new machine? Or some weird
configuration change I made on the old machine that I didn't copy over.
Thanks for any advice,
Ian
some trouble getting my unit tests to run. Can any one suggest what the
vital difference between these two machines might be, or what is causing the
error?
Esentially, my problem is that even though I have installed the ActiveRecord
gem, I am unable to use it in a script.
Old development machine where everything works:
Ruby 1.8.4
Gems 0.8.11
ActiveRecord gem installed 1.15.2
Results of IRB session on the old development machine
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require_gem 'activerecord'
=> true
irb(main):003:0> ActiveRecord
=> ActiveRecord
Ok, so that looks good. I can require the gem & then IRB knows what
ActiveRecord is. Great.
New development machine where this doesn't work
Ruby 1.8.6
Gems 0.9.4
ActiveRecord gem installed 1.15.3
Results of IRB session on the new development machine
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'activerecord'
=> true
irb(main):003:0> ActiveRecord
NameError: uninitialized constant ActiveRecord
from (irb):3
So, something is up. In line 2 I'm using the command newer command 'gem'
instead of the depreciated 'require_gem'. But I get the same result even if
I use the depreciated command.
Any ideas? Something I forgot to install on this new machine? Or some weird
configuration change I made on the old machine that I didn't copy over.
Thanks for any advice,
Ian