我有一个网站上传图像到AWS使用fog-aws。当我在本地运行它时,一切工作正常,但它不会部署到heroku。标准heroku/ruby构建包,所有内容的最新版本:
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.发布于 2019-01-02 09:35:59
弄清楚了;只需要RTFM!
我需要在config/initializers/fog.rb的顶部添加"require 'fog/aws'“。在没有它的情况下在本地工作,但在部署到heroku时导致了上面的行为。我添加了这一行,它起作用了。
https://stackoverflow.com/questions/53998608
复制相似问题