gpt4 book ai didi

ruby-on-rails - 如何解决 AWS Elastic Beanstalk for ruby​​ 2.7.1 上的 Rail 6 部署错误

转载 作者:行者123 更新时间:2023-12-03 20:52:39 25 4
gpt4 key购买 nike

我正在尝试通过 Elastic Beanstalk 在 AWS 上部署 Rails 6 应用程序。

当我跑 eb deploy , 它失败。
当我查看日志时,我看到了这条消息

2020/06/03 14:19:51.457403 [ERROR] rbenv: version `2.7.0' is not installed (set by /var/app/staging/.ruby-version)

2020/06/03 14:19:51.457439 [ERROR] An error occurred during execution of command [app-deploy] - [stage ruby application]. Stop running the command. Error: install dependencies in Gemfile failed with error Command /bin/sh -c bundle config set --local deployment true failed with error exit status 1. Stderr:rbenv: version `2.7.0' is not installed (set by /var/app/staging/.ruby-version)

然而,当我 eb ssh并运行 ruby -v我看到我正在运行 ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
所以我更新了我的 Gemfile.ruby-versionruby 2.7.1以匹配我的 AWS 环境。

当我 cd /var/app/stagingcat .ruby-version我收到 2.7.1
那么为什么这个部署会失败呢?我不需要 ruby 2.7.0在我的项目中的任何地方。

我已经确保 git push ,所以我知道我的 Gemfile 被推送到我的仓库。
试图部署这个 Rails 应用程序我快疯了。

最佳答案

对我有用的是在应用程序的根目录中创建一个 zip 文件:

zip ../rails-default.zip -r * .[^.]
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ruby-rails-tutorial.html

关于ruby-on-rails - 如何解决 AWS Elastic Beanstalk for ruby​​ 2.7.1 上的 Rail 6 部署错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62177291/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com