我有一个网站使用fog-aws gem将图像上传到AWS。当我在本地运行时,一切正常,但不会部署到heroku。标准的heroku / ruby buildpack,所有内容的最新版本:
红宝石2.5.1,导轨5.2.2, 宝石'carrierwave','1.3.1' gem'fog-aws','3.3.0'
已尝试: 1)当然,删除Gemfile.lock文件并捆绑安装几次 2)使用旧版本明确包括formatador(我不认为错误消息是正确的,因为formatador 0.2.5确实存在,我可以在本地和heroku上安装它) 3)使用“雾”代替“雾-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.
答案 0 :(得分:0)
弄清楚了;只是需要RTFM!
我需要在config / initializers / fog.rb的顶部添加一个“ require'fog / aws'”。在没有它的情况下在本地工作,但是在部署到heroku时导致了上述行为。我添加了这一行,并且行得通。