ubuntu – chef-solo错误Errno :: ENOENT:没有这样的文件或目录 – solo.rb

前端之家收集整理的这篇文章主要介绍了ubuntu – chef-solo错误Errno :: ENOENT:没有这样的文件或目录 – solo.rb前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在尝试通过Ubuntu 12.04服务器上的opscode cookbook安装Nginx.我知道这取决于ohai,所以我也下载了这本食谱.当我跑

  1. $sudo chef-solo -c solo.rb

我得到一个错误

  1. FATAL: Errno::ENOENT: No such file or directory - solo.rb

不知道当我在当前目录中时solo.rb是如何丢失的.

  1. $ls
  2. cache cookbooks node.json node.json~ solo.rb solo.rb~

这是debug的输出

  1. $sudo chef-solo -l debug -c solo.rb
  2. [Sun,20 May 2012 14:00:10 -0400] INFO: *** Chef 0.10.10 ***
  3. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Building node object for vagrant-ubuntu-precise
  4. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Extracting run list from JSON attributes provided on command line
  5. [Sun,20 May 2012 14:00:10 -0400] INFO: Setting the run_list to ["recipe[ohai]","recipe[main]","recipe[Nginx]"] from JSON
  6. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Applying attributes from json file
  7. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Platform is ubuntu version 12.04
  8. [Sun,20 May 2012 14:00:10 -0400] INFO: Run List is [recipe[ohai],recipe[main],recipe[Nginx]]
  9. [Sun,20 May 2012 14:00:10 -0400] INFO: Run List expands to [ohai,main,Nginx]
  10. [Sun,20 May 2012 14:00:10 -0400] INFO: Starting Chef Run for vagrant-ubuntu-precise
  11. [Sun,20 May 2012 14:00:10 -0400] INFO: Running start handlers
  12. [Sun,20 May 2012 14:00:10 -0400] INFO: Start handlers complete.
  13. [Sun,20 May 2012 14:00:10 -0400] DEBUG: No chefignore file found at /var/chef/cookbooks/chefignore no files will be ignored
  14. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's library file: /var/chef/cookbooks/chef-jenkins/libraries/manage_node.rb
  15. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/job.rb
  16. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/job.rb into a provider named chef-jenkins_job defined in Chef::Provider::ChefJenkinsJob
  17. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/execute.rb
  18. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/execute.rb into a provider named chef-jenkins_execute defined in Chef::Provider::ChefJenkinsExecute
  19. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/node.rb
  20. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/node.rb into a provider named chef-jenkins_node defined in Chef::Provider::ChefJenkinsNode
  21. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/cli.rb
  22. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/cli.rb into a provider named chef-jenkins_cli defined in Chef::Provider::ChefJenkinsCli
  23. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/job.rb
  24. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/job.rb into a resource named chef-jenkins_job defined in Chef::Resource::ChefJenkinsJob
  25. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/node.rb
  26. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/node.rb into a resource named chef-jenkins_node defined in Chef::Resource::ChefJenkinsNode
  27. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/execute.rb
  28. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/execute.rb into a resource named chef-jenkins_execute defined in Chef::Resource::ChefJenkinsExecute
  29. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/cli.rb
  30. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/cli.rb into a resource named chef-jenkins_cli defined in Chef::Resource::ChefJenkinsCli
  31. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook Nginx's attribute file /var/chef/cookbooks/Nginx/attributes/default.rb
  32. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook Nginx's attribute file /var/chef/cookbooks/Nginx/attributes/geoip.rb
  33. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook Nginx's attribute file /var/chef/cookbooks/Nginx/attributes/source.rb
  34. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook Nginx's attribute file /var/chef/cookbooks/Nginx/attributes/upload_progress.rb
  35. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook ohai's attribute file /var/chef/cookbooks/ohai/attributes/default.rb
  36. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook chef-jenkins's attribute file /var/chef/cookbooks/chef-jenkins/attributes/default.rb
  37. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook Nginx's definitions from /var/chef/cookbooks/Nginx/definitions/Nginx_site.rb
  38. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Loading Recipe ohai via include_recipe
  39. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Found recipe default in cookbook ohai
  40. [Sun,20 May 2012 14:00:10 -0400] INFO: ohai plugins will be at: /etc/chef/ohai_plugins
  41. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Platform ubuntu not found,using all defaults. (Unsupported platform?)
  42. [Sun,20 May 2012 14:00:10 -0400] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action create (ohai::default line 23)
  43. [Sun,20 May 2012 14:00:10 -0400] INFO: Processing cookbook_file[/etc/chef/ohai_plugins/README] action create (dynamically defined)
  44. [Sun,20 May 2012 14:00:10 -0400] ERROR: Running exception handlers
  45. [Sun,20 May 2012 14:00:10 -0400] ERROR: Exception handlers complete
  46. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Re-raising exception: Errno::ENOENT - No such file or directory - solo.rb
  47. /var/chef/cookbooks/ohai/recipes/default.rb:41:in `read'
  48. /var/chef/cookbooks/ohai/recipes/default.rb:41:in `from_file'
  49. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe'
  50. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:46:in `load_recipe'
  51. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:33:in `include_recipe'
  52. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
  53. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
  54. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:72:in `load'
  55. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `each'
  56. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `load'
  57. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:199:in `setup_run_context'
  58. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:162:in `run'
  59. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:207:in `run_application'
  60. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `loop'
  61. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `run_application'
  62. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application.rb:70:in `run'
  63. /var/lib/gems/1.8/gems/chef-0.10.10/bin/chef-solo:25
  64. /usr/local/bin/chef-solo:19:in `load'
  65. /usr/local/bin/chef-solo:19
  66. [Sun,20 May 2012 14:00:10 -0400] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
  67. [Sun,20 May 2012 14:00:10 -0400] DEBUG: Errno::ENOENT: No such file or directory - solo.rb
  68. /var/chef/cookbooks/ohai/recipes/default.rb:41:in `read'
  69. /var/chef/cookbooks/ohai/recipes/default.rb:41:in `from_file'
  70. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe'
  71. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:46:in `load_recipe'
  72. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:33:in `include_recipe'
  73. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
  74. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
  75. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:72:in `load'
  76. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `each'
  77. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `load'
  78. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:199:in `setup_run_context'
  79. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:162:in `run'
  80. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:207:in `run_application'
  81. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `loop'
  82. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `run_application'
  83. /var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application.rb:70:in `run'
  84. /var/lib/gems/1.8/gems/chef-0.10.10/bin/chef-solo:25
  85. /usr/local/bin/chef-solo:19:in `load'
  86. /usr/local/bin/chef-solo:19
  87. [Sun,20 May 2012 14:00:10 -0400] FATAL: Errno::ENOENT: No such file or directory - solo.rb
这是由于厨师的工作方式.它将目录更改为/以避免任何类型的权限问题,但这意味着需要访问命令行参数的插件将不再知道如何到达相对路径.

有一个与厨师代码一起提交的错误解决这个问题.

现在,使用chef-solo参数的完整路径可以解决问题.例如.

  1. $chef-solo -c /full/path/to/solo.rb -j /full/path/to/node.json -l debug

或者正如其他人指出的那样,删除/ etc / chef / ohai_plugins / README文件也会“解决”问题.虽然不是真实的,但由于所有这一切都在触发ohai_plugins文件夹上的修改时间更新,因此触发厨师重新加载所有内容.该功能无法保证,可能会在上述错误修复之前中断.

猜你在找的Nginx相关文章