Bundler could not find compatible versions for gem

2019-08-13 02:44发布

问题:

I am using middleman 3.3.9 and

gem 'sass-rails', '~> 4.0.3'
gem 'bootstrap-sass', '~> 3.3.1'
gem 'bootstrap-timepicker-rails'
gem 'sass', '~> 3.2.19'

When I run bundle install, I get this error:

Bundler could not find compatible versions for gem "sass":
      In Gemfile:
        middleman (~> 3.3.9) ruby depends on
          sass (< 4.0, >= 3.4.0) ruby

        sass (3.2.19)

How can I make this pass?

回答1:

You're having a dependent gem conflict problem. You've locked sass-rails down so it can't bring in a sass that's new enough to satisfy the version of middleman that you're running.

You need to either lower the version of middleman that you're using, or increase the version of sass-rails.



回答2:

update Gemfile with the following line.

gem 'sass', '~> 3.4.0'

Edit

basically you'll need to upgrade all sass dependant gems to a level, every dependant gem uses same version of sass