# Using acts\_as\_ferret outside Rails?

**URL:** <https://www.ruby-forum.com/t/using-acts-as-ferret-outside-rails/82536>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/using-acts-as-ferret-outside-rails/82536 "2007-01-19T16:31:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/using-acts-as-ferret-outside-rails/82536/1 "2007-01-19T16:31:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [September 25, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/using-acts-as-ferret-outside-rails/82536/2 "2007-09-25T22:46:33Z")

</div>

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](http://www.fallenrogue.com/articles/168-Script-vs-Rake)

Ben
