How do you specify a minimum Ruby version in a gemspec?

后端 未结 2 928
感情败类
感情败类 2021-02-11 11:45

I\'m writing a gemspec for a new version of a gem that will now require Ruby 1.9. Previous versions of the gem were ok with Ruby 1.8, but now 1.9 will be required. Is there a wa

2条回答
  •  不知归路
    2021-02-11 12:30

    From the RubyGems documentation:

    # This gem will work with 1.8.6 or greater...
    spec.required_ruby_version = '>= 1.8.6'
    
    # Only with ruby 2.0.x
    spec.required_ruby_version = '~> 2.0'
    

提交回复
热议问题