Sonny Chee
2008-Feb-21 01:37 UTC
How to use ActiveRecord plugins outside of Rails framework?
Hey Guys, I''ve got an acts_as_list association in one of my models. When I attempt to load this file outside of Rails... ie: when I invoke my script via:> ruby -S -I $RAILS_ROOT/app/models myscript.rbI get the following error message: /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1532:in `method_missing'': undefined method `acts_as_list'' for #<Class:0xb7b06924> (NoMethodError) from /home/sonnychee/projects/ngs/app/models/task_prereq.rb:30 How do I get the acts_as_list method defintion loaded up? There are also a bunch of other plugins that I require in the vendor/plugins folder..... Any pointers would be appreciated. Sonny. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Stephan Wehner
2008-Feb-21 05:01 UTC
Re: How to use ActiveRecord plugins outside of Rails framewo
> Any pointers would be appreciated. > > Sonny.This is what script/runner is for. Or do you want to avoid that? Stephan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
AndyV
2008-Feb-21 13:58 UTC
Re: How to use ActiveRecord plugins outside of Rails framework?
Check the ''init.rb'' of each of the plugins. Whatever they do (typically a require along with ARec.send(:include, somthing)) you need to do as well. On Feb 20, 8:37 pm, Sonny Chee <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hey Guys, > > I''ve got an acts_as_list association in one of my models. When I > attempt to load this file outside of Rails... ie: when I invoke my > script via: > > > ruby -S -I $RAILS_ROOT/app/models myscript.rb > > I get the following error message: > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1532:in > `method_missing'': undefined method `acts_as_list'' for > #<Class:0xb7b06924> (NoMethodError) > from /home/sonnychee/projects/ngs/app/models/task_prereq.rb:30 > > How do I get the acts_as_list method defintion loaded up? There are > also a bunch of other plugins that I require in the vendor/plugins > folder..... > > Any pointers would be appreciated. > > Sonny. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sonny Chee
2008-Feb-21 17:52 UTC
Re: How to use ActiveRecord plugins outside of Rails framewo
Stephan Wehner wrote:> > > This is what script/runner is for.Awesome, thanks Stephan. This is exactly what I was looking for. Sonny. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sonny Chee
2008-Feb-21 17:53 UTC
Re: How to use ActiveRecord plugins outside of Rails framewo
AndyV wrote:> Check the ''init.rb'' of each of the plugins. Whatever they do > (typically a require along with ARec.send(:include, somthing)) you > need to do as well. >Thanks Andy. Good for future reference. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---