Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on stop: cannot load such file -- daemons/rails/config (LoadError) #13

Open
russkuhn opened this issue Aug 26, 2013 · 2 comments
Open

Comments

@russkuhn
Copy link

Just installed this gem and I love what it does. Thank you for creating it. Using just the simple_daemon created by your generator, when I start the daemon everything is fine, logging every 10 seconds. But when I stop it (./lib/daemons/simple_daemon_ctl stop), it creates the log file log/simple_daemon.rb.log containing the errors:

# Logfile created on 2013-08-26 16:50:35 -0400 by logger.rb/36483
I, [2013-08-26T16:50:35.353122 #41824]  INFO -- : *** below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally ***
E, [2013-08-26T16:50:35.353364 #41824] ERROR -- : cannot load such file -- daemons/rails/config (LoadError)
/Users/russ/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
/Users/russ/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
./lib/daemons/simple_daemon_ctl:3:in `<main>'
I, [2013-08-26T16:50:35.353531 #41824]  INFO -- : *** 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 ***
E, [2013-08-26T16:50:35.354616 #41824] ERROR -- : stream closed (IOError)
E, [2013-08-26T16:50:35.354806 #41824] ERROR -- : failed to allocate memory (NoMemoryError)
E, [2013-08-26T16:50:35.354926 #41824] ERROR -- : stack level too deep (SystemStackError)
E, [2013-08-26T16:50:35.355246 #41824] ERROR -- : exception reentered (#<Class:0x007fbfe40e0758>)    
E, [2013-08-26T16:50:35.369170 #41824] ERROR -- : cannot load such file -- daemons/rails/config (LoadError)
/Users/russ/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
/Users/russ/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
./lib/daemons/simple_daemon_ctl:3:in `<main>'

The only change I made to the generated code was commenting out Rails.logger.auto_flushing = true because I use log4r. Everything seems to work, but it would be better not to have errors in the log file.

I'm using rvm, ruby 2.0.0p247, and Rails 4.0.0.

-Russ

@ppworks
Copy link

ppworks commented Jun 29, 2015

Solution1

Exec touch log/simple_daemon.rb.log before Daemons::Rails.run config[:script], config.to_hash.

Solution2

Set config[:logfilename] = "#{ENV['RAILS_ENV'] || 'development'}.log" before Daemons::Rails.run config[:script], config.to_hash.

@bogdanRada
Copy link
Collaborator

had same issues. This solved my problem :D Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants