torquebox / chef-cookbooks

TorqueBox Chef Cookbooks
12 stars 12 forks source link

undefined method `run_state' for Chef::Resource::RunitService #4

Open ghost opened 11 years ago

ghost commented 11 years ago

I'm getting the following error when installing the torquebox::server recipe:

================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/torquebox/recipes/server.rb
================================================================================

NoMethodError
-------------
undefined method `run_state' for Chef::Resource::RunitService

Cookbook Trace:
---------------
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/torquebox/recipes/server.rb:79:in `from_file'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/torquebox/recipes/server.rb:77:in `from_file'

Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/torquebox/recipes/server.rb:

 72:    group "torquebox"
 73:    mode "0755"
 74:    action :create
 75:  end
 76:
 77:  runit_service "torquebox" do
 78:    options   node[:torquebox]
 79>>   run_state node[:torquebox][:run_state]
 80:  end
 81:
 82:  announce(:torquebox, :server)
 83:
 84:  # otherwise bundler won't work in jruby
 85:  gem_package 'jruby-openssl' do
 86:    gem_binary "#{current}/jruby/bin/jgem"
 87:  end
 88:

[2013-02-28T17:28:27+00:00] ERROR: Running exception handlers
[2013-02-28T17:28:27+00:00] ERROR: Exception handlers complete
[2013-02-28T17:28:27+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-02-28T17:28:27+00:00] FATAL: NoMethodError: undefined method `run_state' for Chef::Resource::RunitService
ghost commented 11 years ago

Alright, I think I found the problem, but I'm not sure how to fix it. It looks like you're using runit from ironfan-pantry. OpsCode also has a cookbook called runit. By default, the version from OpsCode is being intsalled. At a minimum, the Torquebox chef cookbook documentation should be updated to specify the correct version of runit.

nicolasgarnil commented 11 years ago

How did you solve this issue?

ghost commented 11 years ago

I installed the runit cookbook from https://github.com/infochimps-labs/ironfan-pantry/tree/master/cookbooks/runit and that worked.