views:

702

answers:

1

I am having issues getting a workling daemon working correctly. When I run:

ruby script/workling_client run

the daemon starts to load rails, but hangs indefintely. When I kill the process, the stack trace is always the same:

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/core_ext/load_error.rb:32:in `new': Interrupt
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /Library/Ruby/Gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:68
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
 ... 81 levels...
from /Library/Ruby/Gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `call'
from /Library/Ruby/Gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `catch_exceptions'
from /Library/Ruby/Gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:138:in `run'
from script/workling_client:18

If I run the script without the daemons library, it works as expected. I have, in fact, had trouble using the daemon gem to load anything that requires my rails environment. Any ideas?

UPDATE: The workling_client loads worklings listen.rb as a daemon. Instead of loading rails in listen.rb, I changed it so that it gets loaded in workling_client instead, and the process works without a hitch. Therefore, there is some reason that I can't load rails in a daemonized script :-(

A: 
sean lynch
No, just the latest (1.0.10)
robinator
That ruins my explanation.I'll keep thinking about it
sean lynch