rod mclaughlin


Ever wondered what '~>' means in a Rails Gemfile? (17 nov 11)

"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."

I THINK this means:

Find the first two numbers in the version, and use the highest gem you can find which matches those two numbers, UNLESS the third number is a word, in which case match that as well as the first two numbers.

 

http://gembundler.com/gemfile.html

 

 



Back
Portland London