0

我有一个使用fog-aws gem 将图像上传到AWS 的网站。当我在本地运行它时一切正常,但它不会部署到heroku。标准 heroku/ruby buildpack,所有内容的最新版本:

ruby 2.5.1,rails 5.2.2,gem 'carrierwave','1.3.1' gem 'fog-aws','3.3.0'

试过:1)当然,删除Gemfile.lock文件并捆绑安装几次2)明确包括formatador,使用旧版本(我认为错误消息不正确,因为formatador 0.2.5确实存在并且我可以安装它在本地和heroku上)3)使用'fog'而不是'fog-aws'(给我类似'unf'的错误,并包含大量不必要的依赖项)

remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.5.1
remote: -----> Installing dependencies using bundler 1.15.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        Fetching gem metadata from https://rubygems.org/........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Your bundle is locked to formatador (0.2.5), but that version could not be found
remote:        in any of the sources listed in your Gemfile. If you haven't changed sources,
remote:        that means the author of formatador (0.2.5) has removed it. You'll need to
remote:        update your bundle to a different version of formatador (0.2.5) that hasn't been
remote:        removed in order to install.
remote:        Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        Fetching gem metadata from https://rubygems.org/........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Your bundle is locked to formatador (0.2.5), but that version could not be found
remote:        in any of the sources listed in your Gemfile. If you haven't changed sources,
remote:        that means the author of formatador (0.2.5) has removed it. You'll need to
remote:        update your bundle to a different version of formatador (0.2.5) that hasn't been
remote:        removed in order to install.
4

1 回答 1

0

弄清楚了; 只需要RTFM!

我需要在 config/initializers/fog.rb 的顶部有一个“require 'fog/aws'”。在没有它的情况下在本地工作,但在部署到 heroku 时会导致上述行为。我添加了那条线,它起作用了。

于 2019-01-02T01:35:58.983 回答