![](/img/trans.png)
[英]Failed to download asset opsworks-ruby2.1 for Install user space OpsWorks ruby package
[英]Opsworks install composer error
我有一個AWS Opsworks設置,需要在實例啟動和應用程序部署時安裝composer,但是安裝失敗。 誰能幫我解決這個問題。 我正在運行以下廚師食譜:
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
顯示在The installation directory "/srv/www/[app_name]/releases/20170113140255" is not writable
中的應用程序是我應用程序列表中的第4個應用程序,但實際上應在其上安裝composer的第一個應用程序(包含composer.json
)。
希望你能幫助我。 謝謝。
當我意識到用戶在配方中應該是“ root”用戶而不是“ ubuntu”用戶時,我就解決了。 ubuntu用戶根本沒有足夠的權限在release文件夾中創建新文件夾。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.