Forum: Ruby can't require ActiveRecord gem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Xavier N. (Guest)
on 2006-03-27 21:14
(Received via mailing list)
According to the manual, if I call ruby this way

     ruby -rubygems script_that_uses_gem

require_gem is not needed, plain require is enough.

This indeed is working as documented with WWW::Mechanize, but not
with ActiveRecord, which loads fine with require_gem. Is this
something known?

-- fxn

Running:

   ruby 1.8.4 (2005-12-24) [powerpc-darwin8.3.0]
   RubyGems 0.8.11
   activerecord (1.13.2)
Jim W. (Guest)
on 2006-03-28 00:03
Xavier N. wrote:
> According to the manual, if I call ruby this way
>
>      ruby -rubygems script_that_uses_gem
>
> require_gem is not needed, plain require is enough.
>
> This indeed is working as documented with WWW::Mechanize, but not
> with ActiveRecord, which loads fine with require_gem. Is this
> something known?
>
> -- fxn
>
> Running:
>
>    ruby 1.8.4 (2005-12-24) [powerpc-darwin8.3.0]
>    RubyGems 0.8.11
>    activerecord (1.13.2)

Make sure you say:   require 'active_record'
Rather than:         require 'activerecord'

"activerecord" is the gem.  "active_record" is the file to be required.

-- Jim W.
Xavier N. (Guest)
on 2006-03-28 00:07
(Received via mailing list)
On Mar 27, 2006, at 22:03, Jim W. wrote:

>>
>
> "activerecord" is the gem.  "active_record" is the file to be
> required.

Gotcha! Thank you very much Jim.

-- fxn
This topic is locked and can not be replied to.