4

phpunitをインストールするvagrantのレシピを作成しましたが、vagranthaltを使用してからvagrantupを使用すると失敗し続けます。

execute "discover phpunit" do
  command "pear channel-discover pear.phpunit.de"
  action :run
end

execute "config phpunit" do
  command "pear config-set auto_discover 1"
  action :run
end

execute "install phpunit" do
  command "pear install pear.phpunit.de/PHPUnit"
  action :run
end

私は得る:

[default] [Thu, 29 Mar 2012 14:39:57 -0700] ERROR: execute[discover phpunit] (phpunit::default line 39) has had an error
[Thu, 29 Mar 2012 14:39:57 -0700] ERROR: execute[discover phpunit] (/tmp/vagrant-chef-1/chef-solo-1/phpunit/recipes/default.rb:39:in `from_file') had an error:
execute[discover phpunit] (phpunit::default line 39) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of pear channel-discover pear.phpunit.de ----
STDOUT: Channel "pear.phpunit.de" is already initialized
4

2 に答える 2

4

が実行されるたびにこのスクリプトがvagrant up実行されているようです。

おそらく次のようなものが必要です。

execute "discover phpunit" do
  command "pear channel-discover pear.phpunit.de"
  action :run
  not_if "which phpunit"
end

あなたの中にあることを確認phpunitしてください$PATH

于 2012-03-29T21:54:14.297 に答える
0

私はおそらく not_if を

not_if { File.exists?('/path/to/phpunit')

$PATH で見つかることに頼るのではなく。

于 2013-06-18T20:11:07.007 に答える