1

我在调试 chef-solo 时出错。

....in 'from_file当我通过 chef-recipes 安装 nginx 时,我可以看到同样的问题。我已经下载安装了epel-release-5-4.noarch.rpm,我也创建了/etc/yum.repos.d/epel.repo

我该怎么办?

* package[vim] action install
* No version specified, and no candidate version available for vim
================================================================================
Error executing action `install` on resource 'package[vim]'
================================================================================


Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for vim


Resource Declaration:
---------------------
# In /root/Development/chef-repo/site-cookbooks/vim/recipes/default.rb

  9: package "vim" do
 10:   action :install
 11: end
 12:



Compiled Resource:
------------------
# Declared in /root/Development/chef-repo/site-cookbooks/vim/recipes/default.rb:9:in `from_file'

package("vim") do
  action [:install]
  retries 0
  retry_delay 2
  package_name "vim"
  cookbook_name :vim
  recipe_name "default"
end
4

2 回答 2

0

如果我从 rpm 安装了 epel-package,它已修复,现在我可以运行我的食谱了。

#
# Cookbook Name:: nginx
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#

yum_package "GeoIP"

yum_package "nginx" do
  action :install
end

template "nginx.conf" do
  path "/etc/nginx/nginx.conf"
  source "nginx.conf.erb"
  owner "root"
  group "root"
  mode 0644
  notifies :reload, 'service[nginx]'
end

service "nginx" do
  action [:enable,:start]
end
于 2013-04-16T09:18:12.600 回答
0

实际上,它似乎已安装。如果我尝试 nginx -t ,我发现了一些错误并且我修复了,那么这个厨师的食谱开始工作没有错误。

于 2013-04-08T06:29:35.010 回答