首页 > 解决方案 > Heroku Push 被拒绝 - 找不到 gem multipart-post

问题描述

我在我的应用程序中完成了 OAuth 的设置,但我似乎无法推送到 Heroku。安装了一个 gem 依赖项(并且一切都在本地工作),但 Heroku 拒绝推送。

我已经尝试删除我的 .lock 文件 .bundle,并且也尝试过捆绑更新。Heroku 不会接受推送

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.5.3
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.1). 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:        Could not find multipart-post-2.0.0 in any of the sources
remote:        Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.17.1). 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:        Could not find multipart-post-2.0.0 in any of the sources
remote:
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed

gem 应该是multipart-post(版本 2.0.0),但由于某种原因,它包含该版本作为 gem 文件的一部分。有什么想法吗?

标签: ruby-on-railsrubyheroku

解决方案


您可以查看RubyGems站点并使用正确的版本格式,例如

gem 'multipart-post', '~> 2.0'

并再次提交生命周期并看看会发生什么


推荐阅读