- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经使用 precise64 设置了一个 Vagrant box,并尝试使用 The Java Cookbook ( http://community.opscode.com/cookbooks/java ) 安装 Oracle Java 7,但出现错误:
Error executing action `install` on resource 'java_ark[jdk]'
我运行 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] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you see
shared folder errors, please make sure the guest additions within the
virtual machine match the version of VirtualBox you have installed on
your host and reload your VM.
Guest Additions Version: 4.2.0
VirtualBox Version: 4.3
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-chef-1/chef-solo-2/roles
[default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
stdin: is not a tty
[2014-01-09T09:25:53+00:00] INFO: *** Chef 10.14.2 ***
[2014-01-09T09:25:55+00:00] INFO: Setting the run_list to ["role[myrecipes]"] from JSON
[2014-01-09T09:25:55+00:00] INFO: Run List is [role[myrecipes]]
[2014-01-09T09:25:55+00:00] INFO: Run List expands to [java]
[2014-01-09T09:25:55+00:00] INFO: Starting Chef Run for precise64
[2014-01-09T09:25:55+00:00] INFO: Running start handlers
[2014-01-09T09:25:55+00:00] INFO: Start handlers complete.
[2014-01-09T09:25:56+00:00] INFO: ruby_block[set-env-java-home] called
[2014-01-09T09:25:56+00:00] INFO: file[/etc/profile.d/jdk.sh] mode changed to 755
[2014-01-09T09:25:56+00:00] INFO: file[/etc/profile.d/jdk.sh] created file /etc/profile.d/jdk.sh
[2014-01-09T09:25:56+00:00] INFO: Adding jdk to /usr/lib/jvm/jdk1.7.0_45
================================================================================
Error executing action `install` on resource 'java_ark[jdk]'
================================================================================
NoMethodError
-------------
undefined method `headers' for Chef::Resource::RemoteFile
Cookbook Trace:
---------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/providers/ark.rb:70:in `download_direct_from_oracle'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/providers/ark.rb:67:in `download_direct_from_oracle'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/providers/ark.rb:108:in `class_from_file'
Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/recipes/oracle.rb
46:
47: java_ark "jdk" do
48: url tarball_url
49: checksum tarball_checksum
50: app_home java_home
51: bin_cmds bin_cmds
52: alternatives_priority 1062
53: action :install
54: end
55:
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/recipes/oracle.rb:47:in `from_file'
java_ark("jdk") do
app_home "/usr/lib/jvm/java-7-oracle-amd64"
checksum "bea330fcbcff77d31878f21753e09b30"
retry_delay 2
owner "root"
default true
url "http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.tar.gz"
retries 0
alternatives_priority 1062
recipe_name "oracle"
action [:install]
bin_cmds ["appletviewer", "apt", "ControlPanel", "extcheck", "idlj", "jar", "jarsigner", "java", "javac", "javadoc", "javafxpackager", "javah", "javap", "javaws", "jcmd", "jconsole", "jcontrol", "jdb", "jhat", "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", "schemagen", "serialver", "servertool", "tnameserv", "unpack200", "wsgen", "wsimport", "xjc"]
cookbook_name :java
supports {:exception=>true, :report=>true}
end
[2014-01-09T09:25:56+00:00] ERROR: Running exception handlers
[2014-01-09T09:25:56+00:00] ERROR: Exception handlers complete
[2014-01-09T09:25:56+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-01-09T09:25:56+00:00] FATAL: NoMethodError: java_ark[jdk] (java::oracle line 47) had an error: NoMethodError: undefined method `headers' for Chef::Resource::RemoteFile
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
我的 Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
# Chef-solo
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["site-cookbooks", "cookbooks"]
chef.roles_path = "roles"
chef.add_role "myrecipes"
end
end
roles/myrecipes.rb
name "myrecipes"
default_attributes(
"java" => {
"install_flavor" => "oracle",
"jdk_version" => 7,
"oracle" => {
"accept_oracle_download_terms" => true
}
}
)
run_list(
"recipe[apt]",
"recipe[openssl]",
"recipe[java]"
)
最佳答案
我认为问题是您使用的 Chef 版本 (10.14.2) 与 java
说明书不匹配。
cookbook 上的 java_ark
资源提供程序的实现尝试在下载 Chef remote_file
资源时使用 header
方法甲骨文安装程序。问题是 header
方法仅在 Chef 11.6.0 中的 remote_file
资源上实现(通过我在 Github 上阅读 Chef 源代码)。
解决方案是升级到最新版本的 Chef,或者使用适用于 Chef 10.x 的旧版本 java
说明书。 (后者可能是个坏主意......除非你准备在相关属性中手动设置最新的Oracle下载URL和校验和......)
关于java - Vagrant、Chef-solo 和 Java Recipe : Error executing action `install` on resource 'java_ark[jdk]' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21016295/
我的打包代码包含打包厨师 solo 供应商 { "type": "chef-solo", "cookbook_paths": ["chef/cookbooks/vendor"], "run
我理解 chef-client --daemonize 的目的,因为它是 Chef Server 可以连接和交互的服务。 但 chef-solo 是一个简单地使当前系统符合规范然后完成的命令。 那么
我正在尝试断言文本“abcd:移至历史记录”。所以我的代码是这样的: assertTrue("消息未显示",solo.searchText("abcd : 移至历史记录")); 虽然屏幕上显示消息“a
我创建了测试项目。在那里我创建了文件夹“robotium”并粘贴了 2 个 robotium jar 文件(robotium-solo-3.4.1-javadoc.jar 和 robtium-solo
在 Redhat/Fedora 上安装 Chef-solo 的正确方法是什么? 我尝试按照 opscode wiki 上的说明进行操作,但运行后 gem install chef --no-ri --
当我运行引导命令时,它会多次询问密码 Running Chef on 123.123.123.123... Installing Librarian cookbooks... Uploading th
我在我的 robotium 测试用例中使用 solo.searchText 函数。我将文本作为“$ testdata”传递以进行搜索。但即使屏幕上有文字,它也不会检测到文字。在使用 solo.sear
chef-solo 在安装 redis 时卡在最后,就好像 chef 在等待某个事件发生一样。这是我不得不用 ctrl+c 杀死它时的输出。 [2013-05-14T15:55:27+00:00] 错
我有一个测试类,但总是在 tearDown() 中得到一个 NullPointerException,有人知道为什么吗? public class LaunchManagerActivityTest
我不知道为什么我在互联网上找不到任何关于这个的信息。 我基本上想编写一个提示用户输入他们的 github 用户名/密码的 Recipe ,然后发布到 github API 以添加一个 ssh key
我已经为此苦苦挣扎了几个小时,但似乎没有取得任何进展。关于我应该从哪里开始调试的任何提示将不胜感激。 我正在尝试配置一个 Vagrant 机器并收到以下错误。 `==> default: Runnin
当使用 Vagrant 和厨师作为供应者时,我得到以下警告: [web] Chef 11.12.2 Omnibus package is already installed. [web] Runnin
我有一个似乎与此类似的问题:Berkshelf cookbooks are not being copied to the Vagrant directory , 但我相信它是不同的。 当我运行一个
我已经设置了一个基本的 Chef 基础架构,其中包含一个工作站、一个托管的 Chef 服务器和一个用作节点的 Ubuntu 服务器。我在我的工作场所使用此设置,因此需要代理才能连接互联网。我已经在 k
我正在使用 Chef-solo,以避免管理多个实例的麻烦(如果您认为这不是一个好主意,请纠正我) 我定义了一个“数据库”角色;我在目标节点上使用 Chef-solo 进行 cooking 。 现在,我
我正在使用 robotium 来测试我的应用程序。问题出在 solo.searchText 函数上。在我的应用程序中,我使用 expandale listview 来显示类别值。在使用 robotiu
我正在使用 robotium 来测试一个 android 项目。我有一个测试用例,我需要在其中测试一条由特殊字符组成的消息是否正确发布。所以我创建了一个由特殊字符组成的常量: public stati
我已经在 Redhat Linux 7.2 中安装了 ChefDK rpm 包。 chef-solo --version 命令提供了正确的版本(Chef:12.19.36)。 现在我尝试使用以下 ch
在我的 Activity 中,我执行 startActivityForResult(MediaStore.ACTION_IMAGE_CAPTURE), 然后我进入内置相机 Activity (在本例中
我从 Chef 社区下载了食谱“oc-java-master”,现在我尝试使用我安装在 Windows Server 2008 上的 Chef-solo 来运行它。 经过大量的谷歌搜索和 stacko
我是一名优秀的程序员,十分优秀!