Why is older version of sass-rails require higher version of railties (Bundler)

139 Views Asked by At

I have in my Gemfile

gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'

This works fine. If I run bundle update it says "Using sass-rails (4.0.1)". Now if I try to change it to use 4.0.0 (gem 'sass-rails', '4.0.0') and run bundle update, it gives me error:

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      railties (= 4.0.0) ruby

    sass-rails (= 4.0.0) ruby depends on
      railties (4.0.1)

I don't understand why lower version sass-rails requires higher version railties? That seems strange to me, how can that be? In fact that's a lie!

In another project (Rails Tutorial sample_app) I have

gem 'rails', '4.0.0'
gem 'sass-rails', '4.0.0'

and only railties (4.0.0), yet bundle update works fine. So it seems the error above is not the problem. Then I don't know what is?!

I found more info here - can't get gemfile to allow for bundle update (if I switch order of rails and sass-rails in gemfile then 4.0.0 works fine). However it still doesn't make sense why my Gemfile works fine in one project and not the other with the same sass-rails and rails gems and the same railties.

0

There are 0 best solutions below