Active Record not found



I'm new to ruby, so I may have this all wrong. I'm trying to use
activerecord to manage database functions for a small script I'm
writing. I've installed the activerecord gem, and verified it's in the
list of local gems.

require 'net/http'
require 'rubygems'
gem 'activerecord'

ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:host => 'localhost',
:username => 'root',
:password => '',
:database => 'app_development')

class Thing < ActiveRecord::Base
end

when I run I get the error:
app/gatherer.rb:5: uninitialized constant ActiveRecord (NameError)

I've tried running from Aptana, the One-Click install and Instantrails.
I get the same error in each. I'm thinking I must be doing something
wrong.

Any guidance is appreciated.

--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: Rails gem problem
    ... I have begun playing with Ruby on Rails. ... install of ruby and had to reinstall my gems, ... However, this time, it did not install the ActiveRecord gem. ...
    (comp.lang.ruby)
  • Re: gem & require -> returns false?
    ... Gem goes to load active_record and cannot find it, ... is an active_record file in a gem named 'activerecord'. ... again, but since the gem was activated with autorequire, the file is already ... (I've CC'ed the rubygems list to make sure everyone there sees this as well). ...
    (comp.lang.ruby)
  • Re: Ruby error - cannot find ruby gem active record
    ... following error - i am running windows ... I then installed rails using gem insall rails -r -y ... Then, when I try to query through ActiveRecord, it gives me that ...
    (comp.lang.ruby)
  • Re: Odd requirement behavior between two environments
    ... ActiveRecord is. ... ActiveRecord gem installed 1.15.3 ... Results of IRB session on the new development machine ... In line 2 I'm using the command newer command 'gem' ...
    (comp.lang.ruby)
  • Re: Odd requirement behavior between two environments
    ... ActiveRecord is. ... ActiveRecord gem installed 1.15.3 ... Results of IRB session on the new development machine ... In line 2 I'm using the command newer command 'gem' ...
    (comp.lang.ruby)