Heroku推拒绝了,未能通过Bundler安装宝石[英] Heroku push rejected, failed to install gems via Bundler

本文是小编为大家收集整理的关于Heroku推拒绝了,未能通过Bundler安装宝石的处理方法,想解了Heroku推拒绝了,未能通过Bundler安装宝石的问题怎么解决?Heroku推拒绝了,未能通过Bundler安装宝石问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我正在努力将我的代码推到Heroku.在谷歌和堆栈溢出问题上搜索后,我无法找到解决方案.这是我在我尝试"git push heroku master"时得到的:

Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.3
       Unresolved dependencies detected; Installing...
       Fetching source index for http://rubygems.org/
       /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:300:in `open_uri_or_path': bad response Not Found 404 (http://rubygems.org/quick/Marshal.4.8/mail-2.2.6.001.gemspec.rz) (Gem::RemoteFetcher::FetchError)
        from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:172:in `fetch_path'
.
....

最后:

FAILED: http://docs.heroku.com/bundler
 !     Heroku push rejected, failed to install gems via Bundler

error: hooks/pre-receive exited with error code 1
To git@heroku.com:myapp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:myapp.git'

谢谢你的帮助!

推荐答案

我不认为它是一个rails版本问题,也不是它特定于heroku. (我今天在当地开发机上运行bundle install时,我达到了同样的问题,带有Rails 3.0.3.)

在本地运行bundle update,因为安德鲁建议,修复了这个问题.

编辑 : 如评论中的建议:记住git add .,git commit -m "message"

其他推荐答案

我有相同的问题:remote: ! Failed to install gems via Bundler.

如果您看到问题是:

remote:  Your bundle only supports platforms ["x86_64-darwin-16"] but your local platform
remote:  is x86_64-linux. Add the current platform to the lockfile with `bundle  loc
remote:  --add-platform x86_64-linux` and try again.

它是指这个:

Your bundle only supports platforms ["x86_64-darwin-16"] but your local platform is x86_64-linux. Add the current platform to the lockfile with `bundle loc --add-platform x86_64-linux` and try again.

如果您在您的Gemfile.Loc中看到,您只需此处:

PLATFORMS
  x86_64-darwin-16

所以我做了这个命令,在gemfile.loc中添加在你的平台上

bundle lock --add-platform x86_64-linux

这将更新您的Gemfile.Loc:

PLATFORMS
  x86_64-darwin-16
  x86_64-linux

继续:

git add .
git commit -m "add platform x86_64-linux"

再次推动

git push heroku master:main

解决!

其他推荐答案

我解决了这个问题:

  1. 捆绑更新
  2. git添加gemfile.lock
  3. git commit -m'更新gemfile.lock for heroku'
  4. git推送heroku master

本文地址:https://www.itbaoku.cn/post/786414.html