From: Eric Hodel on
On Mar 28, 2010, at 16:21, Albert Schlef wrote:

> I have a question about RubyGems's "~>". Sorry for asking this here.
> I've searched in their "manual", but it's like searching a needle in a
> haystack.

ri Gem::Version

ri Gem::Requirement

> My question is simple:
>
> My gem works only on Ruby 1.8 (that is, it doesn't work on Ruby 1.9 (and
> isn't supposed to)).
>
> In my gem specification I have:
>
> s.required_ruby_version = '~> 1.8'
>
> Is this correct? Or do I have to write '~> 1.8.0' ?

~> 1.8.0 is correct

> Unfortunately, Ruby 1.9's 'gem' installs my gem. I want it to refuse to
> do this. I suspect that's because '~> 1.8' includes all versions of Ruby
> till 2.0 (not including).
>
> So haw can I tell RubyGems that my gem is for 1.8 only?