我有一个AWS Opsworks安装程序,我需要在实例启动和应用程序部署上安装composer,但安装失败。任何人都可以帮我解决这个问题。 我运行此厨师配方:Opsworks安装作曲家错误
node[:deploy].each do |app_name, deploy|
script "install_composer" do
interpreter "bash"
user "ubuntu"
cwd "#{deploy[:deploy_to]}/current"
code <<-EOH
curl -sS https://getcomposer.org/installer | php
php composer.phar install --no-dev
EOH
only_if { ::File.exists?("#{deploy[:deploy_to]}/current/composer.json") }
end
end
我收到以下错误(其中线21是一个与script "install_composer" do
)。
[2017-01-18T11:16:38+00:00] ERROR: Running exception handlers
[2017-01-18T11:16:38+00:00] ERROR: Exception handlers complete
[2017-01-18T11:16:38+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out
[2017-01-18T11:16:38+00:00] ERROR: script[install_composer] (composer::install line 21) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20170118-1672-16lyp81" ----
STDOUT: All settings correct for using Composer
The installation directory "/srv/www/[app_name]/releases/20170113140255" is not writable
Could not open input file: composer.phar
STDERR:
---- End output of "bash" "/tmp/chef-script20170118-1672-16lyp81" ----
Ran "bash" "/tmp/chef-script20170118-1672-16lyp81" returned 1
[2017-01-18T11:16:38+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
我使用的这些实例的组合来构建脚本:
https://github.com/awslabs/opsworks-example-cookbooks/blob/master/phpapp/recipes/appsetup.rb https://github.com/onema/opsworks-chef-cookbooks/blob/master/composer/recipes/install.rb
的设置在Ubuntu实例运行。实例报告为setup_failed
。如果我禁用自定义食谱,实例就会正常启动。
The installation directory "/srv/www/[app_name]/releases/20170113140255" is not writable
中显示的应用程序名称是我的应用程序列表中的第4个应用程序,但是它实际上应该安装composer(包含composer.json
)的第一个应用程序。
希望你能帮助我。谢谢。