以下是eb部署失败的日志。它似乎是预编译的东西。我遇到了与Heroku类似的问题,并且无法解决其中任何一个问题。 Localhost启动很好,但由于UTF-8格式,预编译无法正常工作。关于如何继续,我不太确定。任何建议都将不胜感激。
mexil@nach:~/workspace/dryit$ eb deploy
Creating application version archive "app-80bb-160223_122919".
Uploading dryit/app-80bb-160223_122919.zip to S3. This may take a while.
Upload Complete.
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: [Instance: i-9d55f345] Command failed on instance. Return code: 1 Output: (TRUNCATED)...b assets:precompile' webapp
+ '[' false == true ']'
+ su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
rake aborted!
ArgumentError: invalid byte sequence in UTF-8
Tasks: TOP => assets:precompile
(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.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-9d55f345'. Aborting the operation.
ERROR: Failed to deploy application.
答案 0 :(得分:0)
不确定导致字节问题的是什么,我猜错了某些奇怪的角色,但无论如何,这可能是一种解决方法:
首先,转到AWS控制台中的环境,然后点击软件配置的设备。应该有一个键值对,键是" RAILS_SKIP_ASSET_COMPILATION"值" false"。将其更改为" true" (或者如果不存在,请输入它。)
然后在您的应用中,编辑您的生产环境(config / environments / production.rb),因此它说" config.assets.compile = false"。
最后,在命令行中输入" rake assets:precompile",然后将更改提交到您的git存储库,您应该很高兴。如果您将来更改资产,请记住手动预编译资产。