【发布时间】:2020-08-04 20:10:33
【问题描述】:
我正在尝试将最近从 rails 5.2 更新到 6 的 rails 应用程序上传到 AWS Elastic Beanstalk。我们有其他人在做这件事,但由于大流行,他不得不离开——现在我们的网站有点陷入困境,我无法更新它。我已经搜索了我的问题的许多不同变体,但还没有解决方案。
该应用在 EB 上使用 rails 5.2 运行。我在本地运行 6.0 的应用程序。当我 eb deploy 我得到这个错误:
MacBook-Pro:app $ eb deploy
Starting environment deployment via CodeCommit
--- Waiting for Application Versions to be pre-processed ---
Finished processing application version app-0e294-200420_110159
2020-04-21 00:22:24 INFO Environment update is starting.
2020-04-21 00:23:07 INFO Deploying new version to instance(s).
2020-04-21 00:27:59 ERROR [Instance: i-0e613ac1fe175f3f6] Command failed on instance. Return code: 1 Output: (TRUNCATED)...-- : Writing /var/app/ondeck/public/assets/application-06fe3df6175ba0def3d0e732489f883d0c09de.css.gz
Webpacker requires Node.js ">=10.13.0" and you are using v6.17.1
Please upgrade Node.js https://nodejs.org/en/download/
Exiting!.
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.
2020-04-21 00:27:59 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-04-21 00:28:00 ERROR Unsuccessful command execution on instance id(s) 'i-0e613ac1fe175f3f6'. Aborting the operation.
2020-04-21 00:28:00 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
在此之前它给了我一个捆绑器错误,我可以通过将一个文件添加到安装正确版本的捆绑器的 .ebextensions 中来修复它。我想这个问题的解决方案是相似的。
这篇文章与我的问题很接近: Deploy rails react app with webpacker gem on AWS elastic beanstalk
所以我根据选择的答案将此文件添加到我的 .ebextensions 中:
01_update_note.config
commands:
01_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
02_install_nodejs:
command: yum -y install nodejs
但是,它似乎没有做任何事情,我仍然得到同样的错误。我根据其他一些关于该问题的博客文章尝试了该文件的几个变体,但错误仍然存在。有没有人能够指出我正确的方向或对问题提供任何见解?抱歉,我对 AWS 或 EB 还不是很熟悉,但我会尽力回答其他问题。
【问题讨论】:
标签: amazon-web-services ruby-on-rails-6 webpacker