Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundler could not find compatible versions for gem "mime-types"

I was going through my Gemfile updating to the latest releases when I got this error:

Bundler could not find compatible versions for gem "mime-types":
  In Gemfile:
    rails (= 4.0.2) ruby depends on
      mime-types (~> 1.16) ruby

    mechanize (= 2.7.3) ruby depends on
      mime-types (2.0)

Is it true that Rails 4.0.2 is depending on a much older version of mime-types than a lot of gems that are out there or is there something wrong with my local configuration?

P.S. I tried updating the dependencies with ´bundle update´, but I just got the same error again.

like image 738
Severin Avatar asked Dec 09 '13 07:12

Severin


People also ask

What is MIME type in Rails?

The MIME types defined by Rails and your initializers are the methods that you call on the block object format or the symbols that you pass to respond_to. You may recognise these from the symbols passed to the Mime::Type.


1 Answers

rails requires mime-types with a version of 1.16 or greater, but smaller than 2.0. However, mechanize requires mime-types with a version of 2.0 or greater.

I suggest you drop the mechanize-version to 2.7.2:

gem 'mechanize', '2.7.2'

This will resolve your conflict.

like image 145
mhutter Avatar answered Sep 28 '22 09:09

mhutter