Re: Active Record not found
- From: Gray Bowman <gray.bowman@xxxxxxxxx>
- Date: Sat, 30 Jun 2007 07:16:19 +0900
Jan Friedrich wrote:
activerecord != active_record ;)
To require gems you need also to require rubygems:
require 'rubygems'
require 'active_record'
So I guess I'm really confused then. This is my final code:
require 'net/http'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:host => 'localhost',
:username => 'root',
:password => '',
:database => 'app_development')
class Thing < ActiveRecord::Base
end
This works in IRB, and on the command line. I'm happy now, but still
wondering...
I didn't have to "require 'rubygems'" for this to work, why? Isn't
ActiveRecord a gem? And if so, shouldn't I have to use "gem
'active_record'" instead?
Also, if there wasn't an error on the _old_ line "require
'activerecord'" then ruby found something by that name ... what was it?
Finally, and this is where you can really help me: Where can I find
this info in the documentation. I've looked in the core reference, the
standard lib reference, and read the whole ActiveRecord section and
found nothing telling me how the _right_ way to include this was, what I
found was different people doing it different ways, none of which worked
for me.
--
Posted via http://www.ruby-forum.com/.
.
- Follow-Ups:
- Re: Active Record not found
- From: Michael Hollins
- Re: Active Record not found
- References:
- Active Record not found
- From: Gray Bowman
- Re: Active Record not found
- From: Jan Friedrich
- Active Record not found
- Prev by Date: Re: Rake::Application#run question
- Next by Date: Re: How to set Browser Encoding?
- Previous by thread: Re: Active Record not found
- Next by thread: Re: Active Record not found
- Index(es):
Relevant Pages
|