kennethkalmer / daemon-kit

Daemon Kit aims to simplify creating Ruby daemons by providing a sound application skeleton (through a generator), task specific generators (jabber bot, etc) and robust environment management code.
http://kennethkalmer.github.com
538 stars 63 forks source link

Update to from 2.3 to 3.1 failed #89

Closed wulftone closed 9 years ago

wulftone commented 9 years ago

Ran into this issue when trying to update from 2.3 to 3.1:

$ bundle exec rake
rake aborted!
NameError: uninitialized constant Class::ERB
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/config.rb:32:in `load'
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/config.rb:39:in `hash'
/Users/me/work/sailthru-daemon/config/pre-daemonize/sailthru-daemon.rb:1:in `<top (required)>'
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/initializer.rb:156:in `require'
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/initializer.rb:156:in `block in load_predaemonize_configs'
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/initializer.rb:153:in `each'
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/initializer.rb:153:in `load_predaemonize_configs'
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/initializer.rb:100:in `before_daemonize'
/Users/me/.rvm/gems/ruby-2.1.1/gems/daemon-kit-0.3.1/lib/daemon_kit/initializer.rb:53:in `run'
/Users/me/work/sailthru-daemon/config/boot.rb:25:in `run'
/Users/me/work/sailthru-daemon/config/boot.rb:13:in `boot!'
/Users/me/work/sailthru-daemon/config/boot.rb:50:in `<top (required)>'
/Users/me/work/sailthru-daemon/Rakefile:1:in `require'
/Users/me/work/sailthru-daemon/Rakefile:1:in `<top (required)>'
/Users/me/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/me/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

Looks like something's missing!

kennethkalmer commented 9 years ago

Oh snap! Thanks @wulftone for reporting, will have a look!

wulftone commented 9 years ago

Any luck here?

kennethkalmer commented 9 years ago

@wulftone apologies, had a bit of a crazy time leading up to, and during, Rubyfuza this past week. Let me have a look today.

marcbowes commented 9 years ago

I believe this was broken by 8002497 which introduced a dependency on ERB in config.rb without requiring it. A test was added for this, so why didn't it catch it?

The reason appears to be that rspec requires erb, so this is why it passes under test:

puts(require "rspec")
puts(require "erb")
$ ruby /tmp/foo.rb
true
false
kennethkalmer commented 9 years ago

@marcbowes legend, thanks!