【问题标题】:Heroku App is not working after changing aws-gem, works fine on local machineHeroku 应用程序在更改 aws-gem 后无法运行,在本地机器上运行良好
【发布时间】:2018-05-28 20:58:31
【问题描述】:

我的 Gemfile 中曾经有 gem 'aws-sdk',但将其更新为 gem 'aws-sdk-s3' 以防止不必要的包加载。虽然这在我的本地机器上运行良好,但 heroku 应用程序崩溃并出现以下错误:

cannot load such file -- aws-sdk (You may need to install the aws-sdk gem))

在将我的新应用上传到 Heroku 时,我确实收到了以下警告,但 Heroku 上的链接对于要采取的操作没有意义:

remote:  !   Warning: You are running on a deprecated stack.
remote:  !   Please upgrade to the latest stack by following the instructions on:
remote:  !   https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack

非常感谢您的帮助,谢谢!

【问题讨论】:

    标签: ruby-on-rails heroku amazon-s3


    【解决方案1】:

    它在本地工作,因为您安装了 aws-sdk gem。它不在服务器上,因为 Gemfile 中缺少它。将此添加到您的Gemfile

    gem "aws-sdk"
    

    然后运行bundle 并提交GemfileGemfile.lock 中的更改

    关于栈,升级很简单https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack#upgrading-an-app

    【讨论】:

    • 这对你有用吗@bo-oz?如果是这样,你可以接受我的回答。
    • 嗨,Thomas,它确实有效,但结果是我的应用程序现在正在加载整个 aws-sdk gems 套件。我正在使用“aws-sdk-s3”版本来防止这种情况。有什么想法可以实现吗?顺便说一句,它正在被回形针消耗掉。很高兴在此之后接受您的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-16
    • 1970-01-01
    • 2020-12-18
    • 2021-05-14
    • 2020-08-03
    • 1970-01-01
    相关资源
    最近更新 更多