close

[Solved] 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

Hello Guys, How are you all? Hope You all Are Fine. I am facing an 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. So Here I am Explain to you all the possible solutions Here.

Without Wasting your time, Lets start This Article to Solve This Error.

How 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 Error Occurs ?

When 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

How to Solve 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 Error ?

Question: How to Solve 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 Error ?
Answer: 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

Solution 1

If you are using macOS. You should try below Commands.

brew install shared-mime-info
bundle update mimemagic

Solution 2

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

Solution 3

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 4

bundle update --conservative mimemagic 

also try with newer version rather than locking it. it worked for us with 0.3.9, but now there is 0.3.10(have not tried it).

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment