Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install Rails 4.2.6 with Ruby 1.9.3 #24749

Closed
urimaro opened this issue Apr 27, 2016 · 8 comments
Closed

Can't install Rails 4.2.6 with Ruby 1.9.3 #24749

urimaro opened this issue Apr 27, 2016 · 8 comments

Comments

@urimaro
Copy link

urimaro commented Apr 27, 2016

Steps to reproduce

gem install rails

Actual behavior

Following error has occurred coz mime-types-data requires Ruby version >= 2.0.

$ gem install rails
Fetching: i18n-0.7.0.gem (100%)
Fetching: json-1.8.3.gem (100%)
Building native extensions.  This could take a while...
Fetching: thread_safe-0.3.5.gem (100%)
Fetching: tzinfo-1.2.2.gem (100%)
Fetching: minitest-5.8.4.gem (100%)
Fetching: activesupport-4.2.6.gem (100%)
Fetching: rack-1.6.4.gem (100%)
Fetching: rack-test-0.6.3.gem (100%)
Fetching: mini_portile2-2.0.0.rc2.gem (100%)
Fetching: nokogiri-1.6.7.2.gem (100%)
Building native extensions.  This could take a while...
Fetching: loofah-2.0.3.gem (100%)
Fetching: rails-html-sanitizer-1.0.3.gem (100%)
Fetching: rails-deprecated_sanitizer-1.0.3.gem (100%)
Fetching: rails-dom-testing-1.0.7.gem (100%)
Fetching: builder-3.2.2.gem (100%)
Fetching: erubis-2.7.0.gem (100%)
Fetching: actionview-4.2.6.gem (100%)
Fetching: actionpack-4.2.6.gem (100%)
Fetching: activemodel-4.2.6.gem (100%)
Fetching: arel-6.0.3.gem (100%)
Fetching: activerecord-4.2.6.gem (100%)
Fetching: globalid-0.3.6.gem (100%)
Fetching: activejob-4.2.6.gem (100%)
Fetching: mime-types-data-3.2016.0221.gem (100%)
ERROR:  Error installing rails:
    mime-types-data requires Ruby version >= 2.0.

System configuration

Rails version: 4.2.6

Ruby version: 1.9.3-p551

@Bijendra
Copy link

Workaround for this:
gem install rails -v=4.2.6
```
ERROR: Error installing rails:
mime-types-data requires Ruby version >= 2.0.

Install
   gem install mime-types -v 2.6.2
Now,
    gem install rails works


@vipulnsward
Copy link
Member

Thanks for reporting!
Can you open this for mime-types/mime-types-data gem, as it is related to them. cc @schneems

@urimaro
Copy link
Author

urimaro commented Apr 27, 2016

@Bijendra
Thanks for your reply.
I tried the commands below but it doesn't make it.
Did you try it?

$ gem install mime-types -v 2.6.2
Fetching: mime-types-2.6.2.gem (100%)
Successfully installed mime-types-2.6.2
1 gem installed
Installing ri documentation for mime-types-2.6.2...
Installing RDoc documentation for mime-types-2.6.2...
$ gem install rails -v 4.2.6
Fetching: mail-2.6.4.gem (100%)
Fetching: actionmailer-4.2.6.gem (100%)
Fetching: thor-0.19.1.gem (100%)
Fetching: railties-4.2.6.gem (100%)
Fetching: bundler-1.11.2.gem (100%)
Fetching: concurrent-ruby-1.0.1.gem (100%)
Fetching: sprockets-3.6.0.gem (100%)
Fetching: sprockets-rails-3.0.4.gem (100%)
Fetching: rails-4.2.6.gem (100%)
ERROR:  Error installing rails:
    mime-types-data requires Ruby version >= 2.0.

@urimaro
Copy link
Author

urimaro commented Apr 27, 2016

@vipulnsward
Thanks for your reply.

Can you open this for mime-types/mime-types-data gem, as it is related to them.

Do you expect me to create an issue for mime-types/mime-types-data gem?
I don't think it'll resolve this issue.

I found lines from Gemfile.lock which is made when I install Rails 4.2.6 with Ruby 2.3.1.

    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    mime-types (3.0)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0221)

Because of mime-types (>= 1.16, < 4), the latest mime-types(3.0) was install
in spite of that mime-types 3.0 requires Ruby 2.

The mime-types author said he had released mime-types 2.99 (requires Ruby 1.9.2 or later).
< The latest version is 2.99.1.
mime-types/mime-types-data#1

According to the above, I think it causes this issue that the mail gem doesn't consider the mime-type version.
What do you think about it?

@urimaro
Copy link
Author

urimaro commented Apr 27, 2016

I found the PR: Pin mime-types to < 3.0 on Ruby 1.9.3.
This PR was merged to master yesterday.

@urimaro
Copy link
Author

urimaro commented Apr 27, 2016

Workaround: Using Bundler and specify the mime-types version

  1. install bundler
    $ gem install bundler

  2. create Gemfile
    $ bundle init

  3. edit Gemfile

    • comment in gem rails
    • add gem 'mime-types', '< 3'

    e.g.

    source "https://rubygems.org"
    
    gem 'rails'
    gem 'mime-types', '< 3'
    
  4. install gems
    $ bundle install

@Bijendra
Copy link

Bijendra commented Apr 27, 2016

@urimaro Yes, i had tried and works perfect for me. The below sequence i tried.

      `514  rvm gemset create rails_test21
       515  rvm gemset list

       517  rvm gemset use rails_test21
       518  gem install mime-types -v 2.6.2
       519  gem install rails
       520  gem uninstall rails
       521  ruby -v
       522  history
      $ rails -v
      Rails 4.2.6
      $ ruby -v
      ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

`

@urimaro
Copy link
Author

urimaro commented Apr 27, 2016

@Bijendra
Thanks.
After your reply, I thought that gems which have already installed are used.
So you suggested gem install mime-types -v 2.6.2.
But it didn't make it.
Hmm..
The reason why v2.6.2 wasn't used is the newer gem may have remained..
Anyway, thanks for your helping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants