The problem with daemons in Rails

I am using daemons gem with Rails in addition to the daemon_generator plugin. I am getting this output in the daemons log file:

 Logfile created on Sat May 09 20:10:35 -0700 2009 by /
-below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally ***
#<NameError: uninitialized constant SmsMessage>
-below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions ***
#<NoMemoryError: failed to allocate memory>
#<SystemStackError: stack level too deep>
#<fatal: exception reentered>
#<MissingSourceFile: no such file to load -- ./config/global_constants.conf>
#<NameError: uninitialized constant SmsMessage>

      

It is very difficult for me to understand this result. It displays different error messages and I can tell that this is not a problem. / config / global _constants.conf because I am not calling it inside the daemon file. Plus I don't think this is a memory issue as my Mac has 2GB of memory and not many programs running. as for SmsMessage, I usually call it using:

scheduledMessagesParent = SmsMessage.valid.find(:all, :conditions => {:status => $SCHEDULED_MESSAGE})

      

which works elsewhere on my site! I noticed that the logger is being called with

ActiveRecord::Base.logger.info "....

      

Is it possible that I have to specify the path to my model in a different way? I usually call the logger using logger.info, without using ActiveRecord :: Base. If so, how do you do it?

Any ideas on how to debug this issue? is there a way to display the stack trace or improve error messages?

0


a source to share


1 answer


I solved this problem by loading the Rails environment with Daemon. It was not included in the tutorial I got the information from, but now it works :)



0


a source







All Articles