1

可能重复:
版本要求中波浪号大于(~>)的含义?

我在 gemspecs 中经常看到这样的东西:

s.add_dependency 'some_gem', '~> 1.5.0'

~> 是什么意思?

4

1 回答 1

7

来自gembundler

The specifier ~> has a special meaning, best shown by example. 
~> 2.0.3 is identical to >= 2.0.3 and < 2.1. 
~> 2.1 is identical to >= 2.1 and < 3.0. 
~> 2.2.beta will match prerelease versions like 2.2.beta.12.
于 2012-09-08T09:41:46.707 回答