How to check the compatible Ruby versions for a gem

后端 未结 3 1407
生来不讨喜
生来不讨喜 2021-01-25 08:58

How do I find out if a particular gem is compatible with a certain Ruby version or not?

I want to upgrade the Ruby version of an application I am working on, But I did n

3条回答
  •  清酒与你
    2021-01-25 09:19

    I suggest looking at the gem's RubyGems page. In the left column, you will find the required Ruby version. For ActiveRecord you will need at least Ruby >= 1.9.3.

    But keep in mind that this only tells you the minimum version number. Because at the time a particular version was released the developer was not able to tell if a certain future version of Ruby might introduce breaking changes.

    For the max supported versions you will have to investigate the release notes or issues. In your example you will find an article "This Week in Rails: Ruby 2.4 on Rails 4.2" that Rails 4.2.8 added support for Ruby 2.4. Therefore I guess that Rails 4.2.7 only supports Ruby 2.3.

提交回复
热议问题