重新开始。 :P @ crum2尝试了apt-get更新,但没有运气。 :\我虽然和我的朋友说话,但他提到我正在使用他不是最可靠的盒子。那么有办法保存.box吗?这是在通过厨师等提供后?需要做更多阅读......显然。所以我改为:
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :public_network
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "nginx"
end
end
我创建了自己的cookbooks目录,并根据以下内容仅下载了我认为需要的内容:http://community.opscode.com/cookbooks/nginx
烹饪
|__build-essential
|__nginx
|__ohai
|__runit
终端输出
mac-mini:test admin$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Available bridged network interfaces:
1) en0: Ethernet
2) en1: Wi-Fi (AirPort)
What interface should the network bridge to? 1
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Running any VM customizations...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] Running provisioner: VagrantPlugins::Chef::Provisioner::ChefSolo...
Generating chef JSON and uploading...
Running chef-solo...
stdin: is not a tty
[2013-04-15T23:42:59+00:00] INFO: *** Chef 10.14.2 ***
[2013-04-15T23:42:59+00:00] INFO: Setting the run_list to ["recipe[nginx]"] from JSON
[2013-04-15T23:42:59+00:00] INFO: Run List is [recipe[nginx]]
[2013-04-15T23:42:59+00:00] INFO: Run List expands to [nginx]
[2013-04-15T23:42:59+00:00] INFO: Starting Chef Run for precise64
[2013-04-15T23:42:59+00:00] INFO: Running start handlers
[2013-04-15T23:42:59+00:00] INFO: Start handlers complete.
[2013-04-15T23:43:00+00:00] INFO: ohai plugins will be at: /etc/chef/ohai_plugins
[2013-04-15T23:43:00+00:00] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action create (ohai::default line 30)
[2013-04-15T23:43:00+00:00] INFO: Processing directory[/etc/chef/ohai_plugins] action create (dynamically defined)
[2013-04-15T23:43:00+00:00] INFO: directory[/etc/chef/ohai_plugins] created directory /etc/chef/ohai_plugins
[2013-04-15T23:43:00+00:00] INFO: directory[/etc/chef/ohai_plugins] mode changed to 755
[2013-04-15T23:43:00+00:00] INFO: Processing cookbook_file[/etc/chef/ohai_plugins/README] action create (dynamically defined)
[2013-04-15T23:43:00+00:00] INFO: cookbook_file[/etc/chef/ohai_plugins/README] mode changed to 644
[2013-04-15T23:43:00+00:00] INFO: cookbook_file[/etc/chef/ohai_plugins/README] created file /etc/chef/ohai_plugins/README
[2013-04-15T23:43:00+00:00] INFO: remote_directory[/etc/chef/ohai_plugins] created directory /etc/chef/ohai_plugins
[2013-04-15T23:43:00+00:00] INFO: remote_directory[/etc/chef/ohai_plugins] mode changed to 755
[2013-04-15T23:43:00+00:00] INFO: Processing ohai[custom_plugins] action reload (ohai::default line 44)
[2013-04-15T23:43:00+00:00] INFO: ohai[custom_plugins] reloaded
[2013-04-15T23:43:00+00:00] INFO: Processing ohai[reload_nginx] action nothing (nginx::ohai_plugin line 22)
[2013-04-15T23:43:00+00:00] INFO: Processing template[/etc/chef/ohai_plugins/nginx.rb] action create (nginx::ohai_plugin line 27)
[2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] updated content
[2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] owner changed to 0
[2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] group changed to 0
[2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] mode changed to 755
[2013-04-15T23:43:00+00:00] INFO: template[/etc/chef/ohai_plugins/nginx.rb] sending reload action to ohai[reload_nginx] (immediate)
[2013-04-15T23:43:00+00:00] INFO: Processing ohai[reload_nginx] action reload (nginx::ohai_plugin line 22)
[2013-04-15T23:43:00+00:00] INFO: ohai[reload_nginx] reloaded
[2013-04-15T23:43:00+00:00] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action nothing (ohai::default line 30)
[2013-04-15T23:43:00+00:00] INFO: Processing ohai[custom_plugins] action nothing (ohai::default line 44)
[2013-04-15T23:43:00+00:00] INFO: Processing package[nginx] action install (nginx::default line 35)
================================================================================
Error executing action `install` on resource 'package[nginx]'
================================================================================
Chef::Exceptions::Exec
----------------------
apt-get -q -y install nginx=1.1.19-1 returned 100, expected 0
Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nginx/recipes/default.rb
34: end
35: package node['nginx']['package_name']
36: service 'nginx' do
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nginx/recipes/default.rb:35:in `from_file'
package("nginx") do
retry_delay 2
retries 0
recipe_name "default"
action :install
cookbook_name :nginx
package_name "nginx"
end
[2013-04-15T23:43:04+00:00] ERROR: Running exception handlers
[2013-04-15T23:43:04+00:00] ERROR: Exception handlers complete
[2013-04-15T23:43:04+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-04-15T23:43:04+00:00] FATAL: Chef::Exceptions::Exec: package[nginx] (nginx::default line 35) had an error: Chef::Exceptions::Exec: apt-get -q -y install nginx=1.1.19-1 returned 100, expected 0
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
Chef Stacktrace
Generated at Mon Apr 15 23:43:04 +0000 2013
Chef::Exceptions::Exec: package[nginx] (nginx::default line 35) had an error: Chef::Exceptions::Exec: apt-get -q -y install nginx=1.1.19-1 returned 100, expected 0
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/command.rb:128:in `handle_command_failures'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/command.rb:75:in `run_command'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/command.rb:143:in `run_command_with_systems_locale'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider/package/apt.rb:97:in `install_package'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider/package.rb:81:in `action_install'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:in `call'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:in `converge!'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:in `converge!'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:136:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:125:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:49:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:378:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:in `do_run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:176:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `loop'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application.rb:70:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25
/opt/vagrant_ruby/bin/chef-solo:19:in `load'
/opt/vagrant_ruby/bin/chef-solo:19
那么我在这里想念的是什么?请随意指出我的阅读材料。
答案 0 :(得分:3)
APT无法在版本1.1.19-1中安装nginx软件包 - 您是否手动指定了该版本?也许在框内运行apt-get update
来刷新包索引并再试一次(由于更新,可能旧的nginx包不可用)。
答案 1 :(得分:1)
所以事实证明,在添加了apt之后解决了我的问题后,这家伙似乎现在已经想到了这一点。这有助于:Error with Chef build-essential cookbook on ubuntu 12.04。删除或保留。 :P