推送代码到 Heroku 时出现错误

4
在将我的代码推送到Heroku时,我遇到了以下错误。
请问有人能够建议我这里缺少什么,这是否是版本问题或其他问题?
git push heroku master

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
       Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
       Unresolved dependencies detected; Installing...
       Using --without development:test
       Fetching source index for http://rubygems.org/
       Could not find multi_json-1.3.3 in any of the sources
       FAILED: http://devcenter.heroku.com/articles/bundler
 !     Heroku push rejected, failed to install gems via Bundler

multi_json 版本 1.3.3 在默认的 gem 存储库中似乎不存在。如果可能的话,只需升级到 1.3.4 即可解决问题。 - Casper
4个回答

1

我也遇到了同样的问题。在Gemfile中添加下面的代码行,并将其推送到Heroku,它就可以工作了。

gem 'multi_json', '1.3.4'

希望这能帮到你!

1

multi_json-1.3.3 目前已被撤下。因此,在 RubyGems 服务器上无法找到该版本。要使其正常工作:

  1. 从 Gemfile 中删除该版本(或将其设置为 1.3.4)
  2. 运行 'bundle update multi_json'
  3. 提交 Gemfile 和 Gemfile.lock 到存储库
  4. 将其推送到 Heroku

希望这可以帮到你!


0
当我遇到这个错误时,我需要删除Gemfile.lock文件。

0

移除了Gemfile.lock文件

将gemfile版本重置为1.3.4

运行bundle

提交gemfile和gemfile仓库

推送到Heroku

推送成功


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接