I''m at kind of a weird roadblock right now. I''m fairly new at rails, but what I am trying to do right now seems too simple to not work. I installed the "spawn" plugin using the following: ruby script/plugin install http://spawn.rubyforge.org/svn/spawn I verified that the plugin was properly installed into vendor/plugins/ spawn. I tried using the code snippets that the author provided: spawn do logger.info("I feel sleepy...") sleep 11 logger.info("Time to wake up!") end and I get the error: undefined method "spawn". From what I understand, since it is in the plugins directory, I do not need to require or otherwise initialize this plugin (although I did try requiring it). I am getting the same error in my application and when using ''ruby script/console'' I don''t see what I am doing wrong. Does anyone have any ideas? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 9 Oct 2008, at 05:10, dangerp wrote:> > I''m at kind of a weird roadblock right now. I''m fairly new at rails, > but what I am trying to do right now seems too simple to not work. I > installed the "spawn" plugin using the following: > > ruby script/plugin install http://spawn.rubyforge.org/svn/spawn > > I verified that the plugin was properly installed into vendor/plugins/ > spawn. I tried using the code snippets that the author provided: > > spawn do > logger.info("I feel sleepy...") > sleep 11 > logger.info("Time to wake up!") > end > > and I get the error: undefined method "spawn". From what I > understand, since it is in the plugins directory, I do not need to > require or otherwise initialize this plugin (although I did try > requiring it). I am getting the same error in my application and when > using ''ruby script/console'' > > I don''t see what I am doing wrong. Does anyone have any ideas?A cursory glance at the code implies that you need to include Spawn. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Spawn is a module, the method you were interested in was a module in that method therefore you need to include that module. Fred Sent from my iPhone On 10 Oct 2008, at 19:41, dangerp <DangerP-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I struggled with this for an hour, and finally found out that it works > if I put the include statement in the controller (I had it in the > model, where my code is). I''m not sure what the mechanics are that > cause this, but at least I''ll know for the future. > > On Oct 9, 1:54 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On 9 Oct 2008, at 05:10, dangerp wrote: >> >> >> >> >> >>> I''m at kind of a weird roadblock right now. I''m fairly new at >>> rails, >>> but what I am trying to do right now seems too simple to not >>> work. I >>> installed the "spawn" plugin using the following: >> >>> ruby script/plugin installhttp://spawn.rubyforge.org/svn/spawn >> >>> I verified that the plugin was properly installed into vendor/ >>> plugins/ >>> spawn. I tried using the code snippets that the author provided: >> >>> spawn do >>> logger.info("I feel sleepy...") >>> sleep 11 >>> logger.info("Time to wake up!") >>> end >> >>> and I get the error: undefined method "spawn". From what I >>> understand, since it is in the plugins directory, I do not need to >>> require or otherwise initialize this plugin (although I did try >>> requiring it). I am getting the same error in my application and >>> when >>> using ''ruby script/console'' >> >>> I don''t see what I am doing wrong. Does anyone have any ideas? >> >> A cursory glance at the code implies that you need to include Spawn. >> >> Fred > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---