将代码推送到 Heroku 时出错



将我的代码推送到 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

也有同样的问题。将下面的代码作为 Gemfile 中的一行添加到 Gemfile 中,并将其推送到 Heroku 并正常工作。

gem 'multi_json', '1.3.4'

希望对您有所帮助!

multi_json-1.3.3 在此期间已被取消。这就是为什么在 rubygems 服务器上找不到它的原因。要使其正常工作:

  1. 从 Gem 文件中删除版本(或将其设置为 1.3.4)
  2. 运行"捆绑包更新multi_json"
  3. 将 Gemfile
  4. 和 Gemfile.lock 提交到存储库
  5. 推到希罗库

希望对您有所帮助!

当我收到此错误时,我需要删除 Gemfile.lock

移除了 Gemfile.lock

将 gemfile 版本重置为 1.3.4

运行捆绑包

提交的 gemfile 和 gemfile 存储库

推到希罗库

推送成功

最新更新