daemon-kit icon indicating copy to clipboard operation
daemon-kit copied to clipboard

Gem load error

Open hunter opened this issue 15 years ago • 3 comments

We seem to be having issues getting certain gems to be loaded correctly. We've been trying to build twitter and superfeedr daemons but our libexec code can't seem to find the gem. The gems have been added in the Gemfile and the pre-daemonize require doesn't raise an error.

When we run the daemon we get this error:


[daemon-kit]: DaemonKit (0.1.8.1) booting in development mode
[daemon-kit]: Setting up trap for USR1
[daemon-kit]: Setting up trap for USR2
[daemon-kit]: Setting up trap for HUP
[daemon-kit]: Setting up trap for INT
[daemon-kit]: Setting up trap for TERM
[daemon-kit]: DaemonKit (0.1.8.1) booted, now running twitter-stream
[daemon-kit]: Running shutdown hooks
[daemon-kit]: Shutting down twitter-stream
/Users/hunter/Sites/active/infinite.ly/daemons/twitter_stream/libexec/twitter_stream-daemon.rb:16:in '': uninitialized constant TweetStream (NameError)
        from /Users/hunter/.rvm/gems/ruby-1.9.2-p0/gems/daemon-kit-0.1.8.1/lib/daemon_kit/application.rb:38:in 'require'
        from /Users/hunter/.rvm/gems/ruby-1.9.2-p0/gems/daemon-kit-0.1.8.1/lib/daemon_kit/application.rb:38:in 'run'
        from /Users/hunter/.rvm/gems/ruby-1.9.2-p0/gems/daemon-kit-0.1.8.1/lib/daemon_kit/application.rb:21:in 'exec'
        from bin/twitter_stream:7:in `
'

The libexec code is straightforward:


DaemonKit::Application.running! do |config|
end

TweetStream::Client.new('user','pass', :yajl).on_delete{ |status_id, user_id|
  # Delete
}.on_limit { |skip_count|
  # do something
}.filter(:track => 'video') do |status, client|
  puts status.inspect
end

What we did find strange was that certain libraries work and others don't. With twitter we've only tried the tweetstream library but when building a superfeedr daemon, the superfeedr-rb library works with no issue but the superfeedr-ruby library doesn't.

We're running ruby 1.9.2 (via rvm) with bundler 1.0.

hunter avatar Aug 29 '10 23:08 hunter

Exactly same issue here... did you solve it ?

ar7hur avatar Feb 29 '12 16:02 ar7hur

Im also finding this to be an issue, trying to require files, inside pre-daemonize. It's not very encouraging to see this ticket is three years old already!!!

sparkbuzz avatar Mar 05 '13 14:03 sparkbuzz

Apologies for letting this gather so much dust. Will have a look to reproduce and push out a fix.

kennethkalmer avatar Aug 16 '13 21:08 kennethkalmer