What does ~> mean in a gem file [duplicate]

In the gem file for https://github.com/justinfrench/formtastic they have:

 gem 'formtastic', '~> 2.0.0'

What does the ~> mean. It actually gives me the error "Could not find gem 'formtastic (~> 2.0.0, runtime)' in any of the gem sources."


Solution 1:

It's a confusing operand, but it limits versions to a subset of the possible versions. So ~> 2.0.0 means ">= 2.0.0 and < 2.1.0" in version numbers.

1.2.3 seems to be the latest version of Formtasic, that's why you're getting this error message.