lib/generators/templates/script.rb in daemons-rails-1.1.1 vs lib/generators/templates/script.rb in daemons-rails-1.1.2
- old
+ new
@@ -3,10 +3,12 @@
# You might want to change this
ENV["RAILS_ENV"] ||= "production"
root = File.expand_path(File.dirname(__FILE__))
root = File.dirname(root) until File.exists?(File.join(root, 'config'))
+Dir.chdir(root)
+
require File.join(root, "config", "environment")
$running = true
Signal.trap("TERM") do
$running = false
@@ -17,6 +19,6 @@
# Replace this with your code
Rails.logger.auto_flushing = true
Rails.logger.info "This daemon is still running at #{Time.now}.\n"
sleep 10
-end
\ No newline at end of file
+end