librelist archives

« back to archive

NameError Exception

NameError Exception

From:
Manuel Gomez
Date:
2010-09-21 @ 17:00
Hi


I installed resque, have redis up and runing, the issue I'm having is that
when I try to place a job in a queue, I get the following error:

NameError Error uninitialized constant EmailCollector

With this call stack:



/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in
`load_missing_constant'

/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in
`const_missing'

/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in
`const_missing'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
`const_get'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
`constantize'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
`each'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
`constantize'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:174:in
`payload_class'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:111:in
`perform'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:157:in
`perform'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:124:in
`work'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
`loop'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
`work'

/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/tasks.rb:24
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19



I'm trying to run a job from the rails console.



Manuel

Re: [resque] NameError Exception

From:
Maurício Linhares
Date:
2010-09-21 @ 17:39
Have you defined the resque:setup task on your application:

It should be defined as follows:

namespace :resque do
  task :setup => :environment
end

-
Maurício Linhares
http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr



On Tue, Sep 21, 2010 at 2:00 PM, Manuel Gomez <manuel@inakanetworks.com> wrote:
> Hi
>
> I installed resque, have redis up and runing, the issue I'm having is that
> when I try to place a job in a queue, I get the following error:
> NameError Error uninitialized constant EmailCollector
> With this call stack:
>
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in
> `load_missing_constant'
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in
> `const_missing'
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in
> `const_missing'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
> `const_get'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
> `constantize'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
> `each'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
> `constantize'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:174:in
> `payload_class'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:111:in
> `perform'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:157:in
> `perform'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:124:in
> `work'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
> `loop'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
> `work'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/tasks.rb:24
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
> `invoke_with_call_chain'
> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
> `invoke_with_call_chain'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> `standard_exception_handling'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> `standard_exception_handling'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
> /usr/bin/rake:19:in `load'
> /usr/bin/rake:19
>
>
> I'm trying to run a job from the rails console.
>
>
> Manuel
>
>

Re: [resque] NameError Exception

From:
Rinaldi Fonseca
Date:
2010-09-21 @ 17:47
What this exactly do?  Because in My apps I didnt set this, and works
normally.

Att

Rinaldi Fonseca
BS  - Computer Science
Pontifical Catholic University of Minas Gerais

Brazil


2010/9/21 Maurício Linhares <mauricio.linhares@gmail.com>

> Have you defined the resque:setup task on your application:
>
> It should be defined as follows:
>
> namespace :resque do
>  task :setup => :environment
> end
>
> -
> Maurício Linhares
> http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
>
>
>
> On Tue, Sep 21, 2010 at 2:00 PM, Manuel Gomez <manuel@inakanetworks.com>
> wrote:
> > Hi
> >
> > I installed resque, have redis up and runing, the issue I'm having is
> that
> > when I try to place a job in a queue, I get the following error:
> > NameError Error uninitialized constant EmailCollector
> > With this call stack:
> >
> >
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in
> > `load_missing_constant'
> >
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in
> > `const_missing'
> >
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in
> > `const_missing'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
> > `const_get'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
> > `constantize'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
> > `each'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
> > `constantize'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:174:in
> > `payload_class'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:111:in
> > `perform'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:157:in
> > `perform'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:124:in
> > `work'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
> > `loop'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
> > `work'
> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/tasks.rb:24
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
> > `invoke_with_call_chain'
> > /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
> > `invoke_with_call_chain'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> > `standard_exception_handling'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> > `standard_exception_handling'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
> > /usr/bin/rake:19:in `load'
> > /usr/bin/rake:19
> >
> >
> > I'm trying to run a job from the rails console.
> >
> >
> > Manuel
> >
> >
>

Re: [resque] NameError Exception

From:
David Balatero
Date:
2010-09-21 @ 17:56
In that case, I believe it ensures the Rails environment setup task gets run
(i.e. your workers require AR, etc)

On Tue, Sep 21, 2010 at 10:47 AM, Rinaldi Fonseca
<rinaldifonseca@gmail.com>wrote:

> What this exactly do?  Because in My apps I didnt set this, and works
> normally.
>
>
> Att
>
> Rinaldi Fonseca
> BS  - Computer Science
> Pontifical Catholic University of Minas Gerais
>
> Brazil
>
>
> 2010/9/21 Maurício Linhares <mauricio.linhares@gmail.com>
>
> Have you defined the resque:setup task on your application:
>>
>> It should be defined as follows:
>>
>> namespace :resque do
>>  task :setup => :environment
>> end
>>
>> -
>> Maurício Linhares
>> http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
>>
>>
>>
>> On Tue, Sep 21, 2010 at 2:00 PM, Manuel Gomez <manuel@inakanetworks.com>
>> wrote:
>> > Hi
>> >
>> > I installed resque, have redis up and runing, the issue I'm having is
>> that
>> > when I try to place a job in a queue, I get the following error:
>> > NameError Error uninitialized constant EmailCollector
>> > With this call stack:
>> >
>> >
>> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in
>> > `load_missing_constant'
>> >
>> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in
>> > `const_missing'
>> >
>> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in
>> > `const_missing'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
>> > `const_get'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
>> > `constantize'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
>> > `each'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
>> > `constantize'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:174:in
>> > `payload_class'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:111:in
>> > `perform'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:157:in
>> > `perform'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:124:in
>> > `work'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
>> > `loop'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
>> > `work'
>> >
>> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/tasks.rb:24
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
>> > `invoke_with_call_chain'
>> > /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
>> > `invoke_with_call_chain'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
>> > `standard_exception_handling'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
>> > `standard_exception_handling'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
>> > /usr/bin/rake:19:in `load'
>> > /usr/bin/rake:19
>> >
>> >
>> > I'm trying to run a job from the rails console.
>> >
>> >
>> > Manuel
>> >
>> >
>>
>
>

Re: [resque] NameError Exception

From:
Maurício Linhares
Date:
2010-09-21 @ 18:01
If you're calling workers from rake, this has to be added so resque
loads your rails application before starting workers (making sure that
everything from your application that you need is loaded).

-
Maurício Linhares
http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr



On Tue, Sep 21, 2010 at 2:47 PM, Rinaldi Fonseca
<rinaldifonseca@gmail.com> wrote:
> What this exactly do?  Because in My apps I didnt set this, and works
> normally.
>
> Att
>
> Rinaldi Fonseca
> BS  - Computer Science
> Pontifical Catholic University of Minas Gerais
>
> Brazil
>
>
> 2010/9/21 Maurício Linhares <mauricio.linhares@gmail.com>
>>
>> Have you defined the resque:setup task on your application:
>>
>> It should be defined as follows:
>>
>> namespace :resque do
>>  task :setup => :environment
>> end
>>
>> -
>> Maurício Linhares
>> http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
>>
>>
>>
>> On Tue, Sep 21, 2010 at 2:00 PM, Manuel Gomez <manuel@inakanetworks.com>
>> wrote:
>> > Hi
>> >
>> > I installed resque, have redis up and runing, the issue I'm having is
>> > that
>> > when I try to place a job in a queue, I get the following error:
>> > NameError Error uninitialized constant EmailCollector
>> > With this call stack:
>> >
>> >
>> > 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in
>> > `load_missing_constant'
>> >
>> > 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in
>> > `const_missing'
>> >
>> > 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in
>> > `const_missing'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
>> > `const_get'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
>> > `constantize'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
>> > `each'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
>> > `constantize'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:174:in
>> > `payload_class'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:111:in
>> > `perform'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:157:in
>> > `perform'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:124:in
>> > `work'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
>> > `loop'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
>> > `work'
>> >
>> > 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/tasks.rb:24
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
>> > `invoke_with_call_chain'
>> > /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
>> > `invoke_with_call_chain'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
>> > `standard_exception_handling'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
>> > `standard_exception_handling'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
>> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
>> > /usr/bin/rake:19:in `load'
>> > /usr/bin/rake:19
>> >
>> >
>> > I'm trying to run a job from the rails console.
>> >
>> >
>> > Manuel
>> >
>> >
>
>

Re: [resque] NameError Exception

From:
Manuel Gomez
Date:
2010-09-21 @ 19:09
Thank you guys, I look over at the documentation again and realized that the
resque workers don't know about the rails enviroment, so I added the
appropiate changes to make this work as specificed in the documentation.

Manuel

2010/9/21 Maurício Linhares <mauricio.linhares@gmail.com>

> If you're calling workers from rake, this has to be added so resque
> loads your rails application before starting workers (making sure that
> everything from your application that you need is loaded).
>
> -
> Maurício Linhares
> http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
>
>
>
> On Tue, Sep 21, 2010 at 2:47 PM, Rinaldi Fonseca
> <rinaldifonseca@gmail.com> wrote:
> > What this exactly do?  Because in My apps I didnt set this, and works
> > normally.
> >
> > Att
> >
> > Rinaldi Fonseca
> > BS  - Computer Science
> > Pontifical Catholic University of Minas Gerais
> >
> > Brazil
> >
> >
> > 2010/9/21 Maurício Linhares <mauricio.linhares@gmail.com>
> >>
> >> Have you defined the resque:setup task on your application:
> >>
> >> It should be defined as follows:
> >>
> >> namespace :resque do
> >>  task :setup => :environment
> >> end
> >>
> >> -
> >> Maurício Linhares
> >> http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
> >>
> >>
> >>
> >> On Tue, Sep 21, 2010 at 2:00 PM, Manuel Gomez <manuel@inakanetworks.com
> >
> >> wrote:
> >> > Hi
> >> >
> >> > I installed resque, have redis up and runing, the issue I'm having is
> >> > that
> >> > when I try to place a job in a queue, I get the following error:
> >> > NameError Error uninitialized constant EmailCollector
> >> > With this call stack:
> >> >
> >> >
> >> >
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in
> >> > `load_missing_constant'
> >> >
> >> >
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in
> >> > `const_missing'
> >> >
> >> >
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in
> >> > `const_missing'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
> >> > `const_get'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
> >> > `constantize'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
> >> > `each'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
> >> > `constantize'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:174:in
> >> > `payload_class'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:111:in
> >> > `perform'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:157:in
> >> > `perform'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:124:in
> >> > `work'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
> >> > `loop'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
> >> > `work'
> >> >
> >> >
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/tasks.rb:24
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
> >> > `invoke_with_call_chain'
> >> > /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
> >> > `invoke_with_call_chain'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
> `invoke_task'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> >> > `standard_exception_handling'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
> >> > `standard_exception_handling'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
> >> > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
> >> > /usr/bin/rake:19:in `load'
> >> > /usr/bin/rake:19
> >> >
> >> >
> >> > I'm trying to run a job from the rails console.
> >> >
> >> >
> >> > Manuel
> >> >
> >> >
> >
> >
>



-- 
Manuel Gómez
skype: mergoc

Re: [resque] NameError Exception

From:
Rinaldi Fonseca
Date:
2010-09-21 @ 17:32
What command are you using to start a worker?

I had a problem like this.

Att

Rinaldi Fonseca
BS  - Computer Science
Pontifical Catholic University of Minas Gerais

Brazil


On Tue, Sep 21, 2010 at 2:00 PM, Manuel Gomez <manuel@inakanetworks.com>wrote:

> Hi
>
>
> I installed resque, have redis up and runing, the issue I'm having is that
> when I try to place a job in a queue, I get the following error:
>
> NameError Error uninitialized constant EmailCollector
>
> With this call stack:
>
>
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in
`load_missing_constant'
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in
`const_missing'
> 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in
`const_missing'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
`const_get'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:58:in
`constantize'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
`each'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/helpers.rb:57:in
`constantize'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:174:in
`payload_class'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/job.rb:111:in
`perform'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:157:in
`perform'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:124:in
`work'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
`loop'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/worker.rb:110:in
`work'
> 
/home/manuel/projects/mingly_website/vendor/plugins/resque/tasks/../lib/resque/tasks.rb:24
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in 
`invoke_with_call_chain'
> /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in 
`invoke_with_call_chain'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in 
`standard_exception_handling'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in 
`standard_exception_handling'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
> /usr/bin/rake:19:in `load'
> /usr/bin/rake:19
>
>
>
> I'm trying to run a job from the rails console.
>
>
>
> Manuel
>
>
>
>