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?