首页 > 解决方案 > Heroku push 被拒绝错误:无法通过 Bundler 安装 gems(可能由 mimemagic 引起)

问题描述

我尝试在heroku上推送我的项目并弹出错误消息

git push heroku master


    remote: -----> Building on the Heroku-18 stack
    remote: -----> Using buildpack: heroku/ruby
    remote: -----> Ruby app detected
    remote: -----> Installing bundler 2.2.11
    remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
    remote: -----> Compiling Ruby/Rails
    remote: -----> Using Ruby version: ruby-2.6.3
    remote: -----> Installing dependencies using bundler 2.2.11
    remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
    remote:        Fetching gem metadata from https://rubygems.org/............
    remote:        **Your bundle is locked to mimemagic (0.3.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 mimemagic (0.3.5) has removed it. You'll need to update
    remote:        your bundle to a version other than mimemagic (0.3.5) that hasn't been removed
    remote:        in order to install.
    remote:        Bundler Output: Fetching gem metadata from https://rubygems.org/............
    remote:        Your bundle is locked to mimemagic (0.3.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 mimemagic (0.3.5) has removed it. You'll need to update
    remote:        your bundle to a version other than mimemagic (0.3.5) that hasn't been removed
    remote:        in order to install.
    remote: 
    remote:  !
    remote:  !     Failed to install gems via Bundler.
    remote:  !
    remote:  !     Push rejected, failed to compile Ruby app.
    remote: 
    remote:  !     Push failed
    remote:  !

我猜这个问题是由 rails gem mimemagic 的版本过时引起的,所以我尝试更新到最新版本,它仍然无法正常工作。

这是我的 ruby​​,Rails,mimemagic 版本

ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]

rails -v
Rails 6.1.3.1

bundle info mimemagic
  * mimemagic (0.4.3)

Gemfile 中的信息

gem 'rails', '~> 6.1', '>= 6.1.0'
gem 'bundler', '~> 2.2', '>= 2.2.1.1'
gem 'mimemagic', '~> 0.4.3'

在 Gemfile.lock

 mimemagic (~> 0.4.3)

标签: ruby-on-railsheroku

解决方案


跑步bundle update mimemagic对我有用


推荐阅读