簡體   English   中英

無法部署應用程序-AWS Eb上的ruby

[英]Failed to deploy application - ruby on aws eb

當我嘗試通過以下命令在eb cli上的AWS上部署我的ruby應用程序時,

eb init,

eb create staging3 -db.engine postgres

我收到以下錯誤

2019-01-25 20:51:40    ERROR   [Instance: i-058d307792dcfcce7] Command failed on instance. Return code: 1 Output: (TRUNCATED)...b:1:in `<top (required)>'
/var/app/ondeck/config/environment.rb:5:in `<top (required)>'
/opt/rubies/ruby-2.6.0/bin/bundle:23:in `load'
/opt/rubies/ruby-2.6.0/bin/bundle:23:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace). 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2019-01-25 20:51:41    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-01-25 20:51:41    ERROR   Unsuccessful command execution on instance id(s) 'i-058d307792dcfcce7'. Aborting the operation.
2019-01-25 20:51:41    ERROR   Failed to deploy application.

日志

+ '[' false == true ']'
  + su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
  `/home/webapp` is not a directory.
  Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
  DEPRECATION WARNING: `config.static_cache_control` is deprecated and will be removed in Rails 5.1.
  Please use
  `config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=2592000' }`
  instead.
   (called from block in <top (required)> at /var/app/ondeck/config/environments/production.rb:28)
  intializing git
  sh: git: command not found
  sh: line 0: cd: /home/webapp: No such file or directory
  rake aborted!
  SyntaxError: /opt/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/devise-4.2.1/app/controllers/devise/sessions_controller.rb:5: syntax error, une
xpected '{', expecting end
  ...ion only: [:create, :destroy] { request.env["devise.skip_tim...
  ...                              ^
  /opt/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/devise-4.2.1/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '}', 
expecting end
  ..."devise.skip_timeout"] = true }
  ...                              ^
  /var/app/ondeck/config/routes.rb:2:in `block in <top (required)>'
  /var/app/ondeck/config/routes.rb:1:in `<top (required)>'
  /var/app/ondeck/config/environment.rb:5:in `<top (required)>'
  /opt/rubies/ruby-2.6.0/bin/bundle:23:in `load'
  /opt/rubies/ruby-2.6.0/bin/bundle:23:in `<main>'

詳細的日志文件
在heroku中嘗試過,但效果很好。

如日志輸出所示,您的實例上似乎沒有安裝git命令:

intializing git
sh: git: command not found

我認為您應該可以通過將以下內容添加到.ebextensions/ruby.config文件中來進行安裝:

packages:
  yum:
    git: []

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM