使用AWS EB进行部署但存在错误

时间:2018-12-21 23:15:39

标签: ruby-on-rails ruby amazon-web-services amazon-elastic-beanstalk

问题:我收到错误消息,但不确定为什么并且没有找到很多有帮助的文档或与我的问题有关的任何内容。

我创建应用,先执行“ eb init”,然后执行“ eb create”

在创建结束时,出现此错误:

ERROR   [Instance: i-00ae954ad2b716b2a] Command failed on instance. Return code: 1 Output: (TRUNCATED)...lizers/carrierwave.rb:1:in `<main>'
/var/app/ondeck/config/environment.rb:5:in `<main>'
/opt/rubies/ruby-2.5.3/bin/bundle:23:in `load'
/opt/rubies/ruby-2.5.3/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.
2018-12-21 22:50:56    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2018-12-21 22:51:58    ERROR   Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.

当我进入AWS EB账户仪表板时,“ eb create”一无所有

关于eb状态,我得到:

eb状态

Environment details for: uploader-master-side-3-dev
  Application name: uploader-master-side-3
  Region: us-east-2
  Deployed Version: app-ebd0-181221_1234123412341234
  Environment ID: e-zayv1234123412341243
  Platform: arn:aws:elasticbeanstalk:us-east-2::platform/Puma with Ruby 2.5 running on 64bit Amazon Linux/2.8.7
  Tier: WebServer-Standard-1.0
  CNAME: uploader-master-side-3-dev.us-east-2.elasticbeanstalk.com
  Updated: 2018-12-21 22:59:35.393000+00:00
  Status: Ready
  Health: Red

我在这里做错什么了吗?我检查了一些教程,据我所知,我做了所有正确的事情。

尽管在我的git中,我确实有gitignore文件,例如用于更多AWS桶和carrierwave的文件。这是问题还是其他原因?

这是我的载波文件(错误中提到了这一点):

CarrierWave.configure do |config|
  config.storage    = :aws
  config.aws_bucket = ENV.fetch('S3_BUCKET_NAME')
  config.aws_acl    = 'public-read'

  config.aws_authenticated_url_expiration = 60 * 60 * 24 * 7

  config.aws_attributes = {
    expires: 1.week.from_now.httpdate,
    cache_control: 'max-age=604800'
  }

  config.aws_credentials = {
    access_key_id:     ENV.fetch('AWS_ACCESS_KEY_ID'),
    secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
    region:            ENV.fetch('AWS_REGION'), # Required
    stub_responses:    Rails.env.test? # Optional, avoid hitting S3 actual during tests
  }

end

访问权限位于我的.env文件中

我的.env文件由我的gemfile中的dotenv gem处理,如下所示:

gem 'dotenv-rails', groups: [:development, :test]

这是我第一次将应用程序部署到互联网上,因此我没有在实践中寻求帮助。

谢谢您的时间。

我在想(这是对OP的编辑/更新)。

我有使用该应用所需的.gitignore文件。这是问题所在吗?我只是对这个错误感到困惑,因为我似乎找不到关于该错误的任何实际文档,这甚至对我都没有帮助。我在AWS帐户上看了高低,却一无所获。

还有其他可能吗?

0 个答案:

没有答案