当我尝试通过以下命令在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>'
Detailed log file
在heroku中尝试过,但效果很好。
答案 0 :(得分:0)
在日志输出中看来,git
命令似乎没有安装在您的实例上:
intializing git
sh: git: command not found
我认为您应该可以通过将以下内容添加到.ebextensions/ruby.config
文件中来进行安装:
packages:
yum:
git: []