I know what 'mongoid', '~> 3.1.2'
mean. But if the version has only one number, what does it mean? Does gem 'mongoid', '~> 4' equal to gem 'mongoid', '>= 4'?
Most of the version specifiers, like >= 1.0, are self-explanatory. 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.
捎带@Зелёный的答案将文档专门与这个问题联系起来, '~> 4'
意味着>= 4
和< 5.0
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.