Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of the sources listed in your Gemfile

Ruby on-RailsRuby on-Rails-6Mimemagic

Ruby on-Rails Problem Overview


Today I tried to build a docker for my rails 6.1.0 with active storage, I got the following error:

Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of mimemagic (0.3.5) has removed it. You'll need to update your
bundle to a version other than mimemagic (0.3.5) that hasn't been removed in order to install.

And now I try to install the mimemagic

 gem install mimemagic -v 0.3.5

I've got the following error:

ERROR:  Could not find a valid gem 'mimemagic' (= 0.3.5) in any repository
ERROR:  Possible alternatives: mimemagic

It seems like the gem is gone. Can someone explain this?

what can be the solution to this issue?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

Few days ago, the mimemagic versions were yanked. More info can be found at:

You can modify your Gemfile as below:

gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f'

Solution 2 - Ruby on-Rails

Try to remove the Gemfile.lock and bundle again. Make sure you can actually do that because all your gems will be updated. In my Rails 6.1 instances, mimemagic is no longer used. Done.

If that is not possible, you need to update mimemagic as it seems they removed all versions below 0.3.7: bundle update mimemagic

Update: I'm not sure if it's clear, but rails no longer use mimemagic.

Solution 3 - Ruby on-Rails

If you are using macOS

brew install shared-mime-info
bundle update mimemagic

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionchanna lyView Question on Stackoverflow
Solution 1 - Ruby on-RailsTaranjyot Singh MultaniView Answer on Stackoverflow
Solution 2 - Ruby on-RailsPaulo AbreuView Answer on Stackoverflow
Solution 3 - Ruby on-RailshoneyView Answer on Stackoverflow