8

I recently install clean ubuntu14.04 virtual machine in vware fusion and updated it. I am trying to install the mime-tyes-data by

sudo gem install mime-types-data -v 3.2015.1120

The error shows

ERROR: Error installing mime-types-data: mime-types-data requires Ruby version >= 2.0.

Before that I already update ruby version by

sudo apt-get install ruby2.0

sudo ln -sf /usr/bin/ruby2.0 /usr/bin/ruby

It seems my version of ruby is 2.0 already, but the error still exists.

Peterxwl
  • 1,023
  • 3
  • 16
  • 24

4 Answers4

10

I was facing the same problem trying to install rails with sudo. I was getting: ERROR: Error installing mime-types-data: mime-types-data requires Ruby version >= 2.0.

The thing is ruby -v gives me ruby 2.2.1p85 while sudo ruby -v gives me ruby 1.9.3p484, so instead of sudo gem install rails I just did gem install rails and it worked.

That is where I found my solution: https://github.com/jekyll/jekyll/issues/3558

Hope it helps.

4

I had the same error as others here. I was trying to install JRuby and kept getting

ERROR: Error installing mime-types-data: mime-types-data requires Ruby version >= 2.0

From this page I got that JRuby doesn't use the version of ruby you might think it does. So you can check what it's using by doing:

jruby -v

The version of Ruby is in brackets. Then to upgrade the version of Ruby being used I got a tip from this page which said to add an env var:

set JRUBY_OPTS=--2.0

All working better now, well no error anymore!

Community
  • 1
  • 1
Scala Enthusiast
  • 399
  • 8
  • 18
2

To fix, edit Gemfile

gem "mime-types", '2.6.2'

Then run in terminal.

sudo apt-get install -f

if that does not work, try

sudo apt-get update
sudo apt-get dist-upgrade

as the update to bbb-record-core now includes the above fix

  • The error I described occurred when I am trying to install rails after ruby installed. Could you tell me where the Gemfile located when installing rails? – Peterxwl Mar 27 '16 at 03:59
  • Did you create an app using `rails new APP_NAME`. If you didn't then create a new one. Then `Gemfile` will be automatically created. In the `Gemfile` add the line. Let me know if you face any problem. – Mohammad Shahadat Hossain Mar 27 '16 at 04:01
  • Sorry you may misunderstood my words. I installed ruby, then want to install ruby on rails, not create an app. When I am installing rails, the error occurs shown above. I cannot successfullly install rails framework yet. – Peterxwl Mar 27 '16 at 04:22
  • why you want to install `mime-types-data -v 3.2015.1120` before rails framework installation. First, install rails framework successfully then install `mime-types-data -v 3.2015.1120` as gem. In that case, i think you can proceed with the second and third steps. Lets see if the problem solves in your side. – Mohammad Shahadat Hossain Mar 27 '16 at 04:29
  • I tried installingl rails framework and result is failure. The error shows : ERROR: Error installing mime-types-data: mime-types-data requires Ruby version >= 2.0. The same error shown above. – Peterxwl Mar 27 '16 at 17:09
  • Update your dist libraries. – Mohammad Shahadat Hossain Mar 27 '16 at 17:36
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/107487/discussion-between-mohammad-shahadat-hossain-and-peterxwl). – Mohammad Shahadat Hossain Mar 27 '16 at 20:52
0

Fixed problem by downgrading from rails '4.2.6' to rails '4.1.0'.

Minski
  • 21
  • 2