Error: Mime-Types-Data Requires Ruby Version >= 2.0

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

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.

Gem::InstallError: mime-types-data requires Ruby version = 2.0. and Travis-CI

try to compare the output of

$ ruby -v
$ sudo ruby -v

In general is a good practice to use a version management system. Ruby has rvm. This allows you to set for each and every project the ruby version you want to use.

After installing it, you should declare in the root of your app which version you wanto to use ($ rvm use ruby-x.y.z) and create two files .ruby-version and .ruby-gemset to make your settings available at any time.

Travis has a native support for rvm, so you will be sure about the Ruby version your project is tested against.

Error installing pg, requires Ruby version = 2.2 even if ruby is =2.2

When using RVM, it is necessary for some environment variables to be loaded to RVM (and RVM-installed Rubies) to find its code.

When running your gem install command with sudo however, sudo will reset your $PATH and unset the required environment variables before executing the gem command with the sanitized $PATH. With that, you will likely use your system ruby rather than your RVM-installed ruby.

In general, you should not use sudo to install Rubies or any gems when using RVM. Instead, you generally can and should just use your normal user.

If you do have to use sudo with RVM for some reason, there is a special rvmsudo command which retains your RVM environment in the evaluated context. See https://rvm.io/integration/sudo for details. However, as written above, you should try to avoid using this!

ZenTest requires RubyGems version ~ 1.8

The ~> 1.8 means "Any version of RubyGems, as long as it's 1.8 or higher, but smaller than 2.0". So 1.8.0, 1.8.11, 1.8.100 or 1.9 all match, but the version you have does not.

The 1.9.1 in the gem command does not mean RubyGems is at version 1.9.1, but that it's the version that came with the Ruby 1.9.1 install. To find out what version of RubyGems you have, run gem1.9.1 --version.

To resolve this, you can either upgrade Rubygems, or install a version of ZenTest that is compatible with the version of Rubygems you have by running sudo gem1.9.1 install ZenTest --version "< 4.6" (assuming that ZenTest 4.5 is compatible with your RubyGems)



Related Topics



Leave a reply



Submit