Sheng87
Sheng87

Reputation: 21

Heroku push rejected error: Failed to install gems via Bundler (probably caused by mimemagic)

I try to push my project on heroku and error message pop outs

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:  !

I guess the problem is caused by rails gem mimemagic's version is out of date so I try to update to the latest version, it still doesn't work.

Here's my ruby, Rails, mimemagic version

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)

information in Gemfile

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

in Gemfile.lock

 mimemagic (~> 0.4.3)

Upvotes: 2

Views: 1572

Answers (3)

Stephanie V
Stephanie V

Reputation: 1

Running bundle update will automatically update every dependency on your app to the latest version

Upvotes: 0

bcho
bcho

Reputation: 11

Change version of mimemagic to 0.3.10 in your Gemfile

Mimemagic seems to be experiencing updates? hopefully will be fixed soon. Try changing mimemagic to previous version for now..

Gemfile:

gem 'mimemagic', '~> 0.3.10'

Upvotes: 1

Ervin Ismu
Ervin Ismu

Reputation: 21

run bundle update mimemagic worked for me

Upvotes: 2

Related Questions