Ruby Version as Resolution Dependency

194 views
Skip to first unread message

Richard Schneeman

unread,
Mar 24, 2016, 4:59:53 PM3/24/16
to ruby-bundler
Recently I ran into a problem while running tests on travis for rails_stdout_logging. The tests use various versions of Rails which use mail which uses mime-types. Recently mime-types 3 included a dependency on https://rubygems.org/gems/mime-types-data which is Ruby 2+ only. When bundler resolved the `bundle update` on travis it picked the latest version of mime-types even when being run on Ruby 1.9 versions.


The error:

```
 [32mInstalling mime-types-data 3.2016.0221 [0m

 [33mGem::InstallError: mime-types-data requires Ruby version >= 2.0. [0m
 [32mInstalling xpath 2.0.0 [0m
 [32mInstalling railties 4.0.13 [0m
 [32mInstalling sprockets-rails 2.3.3 [0m
 [32mInstalling activerecord 4.0.13 [0m
 [31mAn error occurred while installing mime-types-data (3.2016.0221), and Bundler
cannot continue.
Make sure that `gem install mime-types-data -v '3.2016.0221'` succeeds before
bundling. [0m

 [31;1mThe command "eval bundle install --jobs=3 --retry=3" failed 3 times. [0m
```


If bundler took into account the Ruby version restrictions it could have been possible to see that mime-types 3 couldn't be installed on the system but a lower dependency could have version 2.6.2.

I'm curious if there has been any talk about incorporating Ruby version restrictions in bundler's gem restrictions. How difficult would something like that be? Has anyone tried before?

André Arko

unread,
Mar 24, 2016, 5:04:12 PM3/24/16
to ruby-b...@googlegroups.com
Hi Richard,

We have extensively discussed this issue on the mailing list and on the issue tracker in the past. Ruby version restrictions were previously only available during the install process, so Bundler was not able to avoid conflicting versions. However, ruby version restrictions are included in the new index format, and Bundler 1.12.rc is will check Ruby version restrictions against the Ruby version set in the Gemfile using the `ruby` method.



--
You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-bundler...@googlegroups.com.
To post to this group, send email to ruby-b...@googlegroups.com.
Visit this group at https://groups.google.com/group/ruby-bundler.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages