2

As of the writing of this question, the latest sass-rails version is 5.0.0.beta1.

I want to update my Gemfile to use this version but also have it continue to use later releases of sass-rails v5 as and when they become available. For the moment, let's assume that I constantly run bundle update sass-rails and don't care for the consequences to my app.

I find that gem 'sass-rails', '>= 5.0' doesn't work. I get this error:

Could not find gem 'sass-rails (>= 5.0) ruby' in the gems available on this machine.

If I fix the version to =5.0.0.beta1, I get the update just fine.

How can I set an optimistic constraint right now, so that bundle update gives me 5.0.0 when it is released, without my having to change the Gemfile?

sameers
  • 4,855
  • 3
  • 35
  • 44

1 Answers1

2

You're on the right track but 5.0.0.beta1 is less than 5.0 you'd need your gemfile to have:

gem 'sass-rails', '>= 5.0.0.beta1'

Then it will update when 5.0 becomes available :)

Sean
  • 2,891
  • 3
  • 29
  • 39
  • Ha. I guess I assumed that the comparison function for versions is the same as for "ASCII sort order," where the string "5.0.0" would be `<` the string "5.0.0.beta1" – sameers Aug 27 '14 at 05:31
  • 1
    Hmm... I'm not sure now though, this might not work, per [issue #1198 I found on bundler's Github repo](https://github.com/bundler/bundler/issues/1198) - the repo owner said, in May 2011: "If you want to switch to a non-prerelease version of the gem later, you will need to remove the .beta from the end of your version requirement." – sameers Aug 27 '14 at 05:43
  • I think that is out of date. To test that I just did a rails new and to show it works I set `gem 'rspec', '>= 3.0.0.beta1' and it installed 3.0.4. (I used rspec since it isn't wasn't already in the gemfile.) – Sean Aug 27 '14 at 14:44