I receive the following error in my chef solo cookbook. I use the apache2
cookbook provided in the cookbooks repo. I simply do the following :
include_recipe "apache2"
It used to work but no longer works as of recently. Am I doing something wrong?
FYI my cookbook is here:
http://github.com/retr0h/chef_solo_apache2/tree/master
ERROR: template[apache2.conf] (/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/recipe.rb line 189) had an error:
different prefix: "/" and "."
/usr/lib/ruby/1.8/pathname.rb:709:in relative_path_from'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/provider/template.rb:55:inaction_create'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:87:in send'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:87:inconverge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:in each'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:inconverge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:58:in each'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:57:ineach'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:63:in converge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:373:inconverge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:101:in run_solo'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/solo.rb:122:inrun_application'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application.rb:57:in run'/usr/lib/ruby/gems/1.8/gems/chef-0.7.4/bin/chef-solo:26/usr/bin/chef-solo:19:inload'/usr/bin/chef-solo:19
/usr/lib/ruby/1.8/pathname.rb:709:in `relative_path_from': different prefix: "/" and "." (ArgumentError)
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/provider/template.rb:55:in `action_create'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:87:in `send'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:87:in `converge'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:in `each'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:85:in `converge'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:58:in `each'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/resource_collection.rb:57:in `each'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/runner.rb:63:in `converge'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:373:in `converge'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/client.rb:101:in `run_solo'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application/solo.rb:122:in `run_application'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/lib/chef/application.rb:57:in `run'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.4/bin/chef-solo:26
from /usr/bin/chef-solo:19:in `load'
from /usr/bin/chef-solo:19
rake aborted!
FWIW I managed to solve this by using full paths instead of relative paths when calling chef solo, e.g. changing from:
to:
--
petef
I had a similar issue here too on OS X Leopard.
Commenting out the two lines in solo.rb, as outlined in this bug report on Jira fixed it for me:
Chris