Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 357
Peterxwl Avatar asked Mar 26 '16 15:03

Peterxwl


3 Answers

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.

like image 172
Allan Oliveira Avatar answered Oct 04 '22 09:10

Allan Oliveira


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!

like image 32
Scala Enthusiast Avatar answered Oct 04 '22 11:10

Scala Enthusiast


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

like image 29
Mohammad Shahadat Hossain Avatar answered Oct 04 '22 10:10

Mohammad Shahadat Hossain