简体   繁体   English

Ruby升级版本和代码兼容性检查器

[英]Ruby upgrade version and code compatibility checker

Is there a way to upgrade the underlying Ruby version of a rails project and be certain there are no breaking changes within the code? 有没有办法升级Rails项目的底层Ruby版本,并确定代码中没有重大更改? I use rvm to maintain my Ruby environment and I know I can simply create a new environment and go from there but that would involve testing the entire application. 我使用rvm维护我的Ruby环境,我知道我可以简单地创建一个新环境并从那里开始,但这将涉及测试整个应用程序。

For example, my Gemfile specifies the following: 例如,我的Gemfile指定以下内容:

ruby '2.0.0'
gem 'rails', '~> 4.0.3'
gem 'rake'

If I were to upgrade to Ruby 2.4 is there any way to check my code to see if there are any breaking changes between versions? 如果要升级到Ruby 2.4,是否有任何方法可以检查我的代码以查看版本之间是否有重大更改?

Turns out if you are using bundler you can do a bundle update and it will update all the gems to the latest compatible versions. 事实证明,如果您使用bundler ,则可以进行bundle update ,它将所有gem更新为最新的兼容版本。 You can then do a bundle clean it will remove unused gems and finally using rvm you can update versions and test functionality. 然后,您可以将其bundle clean ,将其删除未使用的gem,最后使用rvm更新版本并测试功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM