Forum: Ruby on Rails Using acts_as_ferret outside Rails?

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.
83ebc62f7de94a07657f2222d3648cfd?d=identicon&s=25 Ben (Guest)
on 2007-01-19 16:31
(Received via mailing list)
I'm using the acts_as_ferret plugin successfully in a Rails application
but I also need to be able to use it (and ActiveRecord) outside of
Rails. Before I added the acts_as_ferret to the model I was able to use
ActiveRecord outside of Rails, but with acts_as_ferret it fails as
follows:

$ ruby runner.rb development

/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- acts_as_ferret
(MissingSourceFile)
        from
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
        from
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_support/dependencies.rb:489:in
`require'
        from
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_support/dependencies.rb:337:in
`new_constants_in'
        from
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_support/dependencies.rb:489:in
`require'
        from spider.rb:7
        from
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
        from
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
        from
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_support/dependencies.rb:489:in
`require'
        from
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_support/dependencies.rb:337:in
`new_constants_in'
        from
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1.5618/lib/active_support/dependencies.rb:489:in
`require'
        from components/runner.rb:8

I guess that this is something to do with me not including all of the
correct files but I'm having problems working out how. Is there a
'proper' way of using ActiveRecord outside of Rails (using 1.2 RC2)?
Currently I'm using the code sample from the Rails recipes book.

Cheers,

Ben
83ebc62f7de94a07657f2222d3648cfd?d=identicon&s=25 Ben (Guest)
on 2007-09-25 22:46
(Received via mailing list)
Ben wrote:
> I'm using the acts_as_ferret plugin successfully in a Rails application
> but I also need to be able to use it (and ActiveRecord) outside of
> Rails. Before I added the acts_as_ferret to the model I was able to use
> ActiveRecord outside of Rails, but with acts_as_ferret it fails as
> follows:

To reply to my own post, I fixed the problem by following the
guidelines below to create a rake task instead of hacking in the Rails
framework via includes.

http://www.fallenrogue.com/articles/168-Script-vs-Rake

Ben
This topic is locked and can not be replied to.