Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 767
channa ly Avatar asked Apr 02 '21 12:04

channa ly


People also ask

How do I install a specific version of a gem?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

How is Gemfile lock created?

When you first call bundle install, it will create this Gemfile. lock and uses this file in all subsequent calls to bundle install, which ensures that you have all the dependencies installed and will skip dependency installation.

How do I uninstall gem bundler?

Installation and usage To install a prerelease version (if one is available), run gem install bundler --pre . To uninstall Bundler, run gem uninstall bundler .

What is listen gem?

The Listen gem listens to file modifications and notifies you about the changes.

Why can't I install mimemagic on my bundle?

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. Upon further investigation, I found this github issue.

Why can't I install mimemagic in my Gemfile?

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.

How to get rid of mimemagic?

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.

Where can I find the shared-mime database?

For my case this was the solution from macOS: 'You will require a copy of the Freedesktop.org shared-mime-info database to be available. If you're on Linux, it's probably available via your package manager, and will probably be in the location it's being looked for when the gem is installed.


2 Answers

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

  • https://github.com/rails/rails/issues/41750
  • https://rubygems.org/gems/mimemagic/versions

You can modify your Gemfile as below:

gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f' 
like image 172
Taranjyot Singh Multani Avatar answered Oct 23 '22 03:10

Taranjyot Singh Multani


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.

like image 20
Paulo Abreu Avatar answered Oct 23 '22 02:10

Paulo Abreu