寻找适用于App的推荐升级路径(Ruby 2.3.8,Rails 4.2.11)到最新稳定版本的Ruby和Rails
如标题所述,我正在寻找适用于最新稳定版本的Ruby和Rails的应用程序的推荐路径(Ruby 2.3.8,Rails 4.2.11),这是非常非常大的最安全,最稳定的选项代码库。
例如
最好先将Ruby升级到2.4,然后升级为2.5,然后再升级,然后回到四处升级轨道(例如4.2 => 5.0.x => 5.1.x =>。 ..)?
哪种红宝石版本是最新版本,可用于运行Rails 4.2.x?
任何建议 /指导将不胜感激。
as the title states, I'm looking for a recommended path for app (ruby 2.3.8 , rails 4.2.11) to the latest stable versions of ruby and rails, that is the safest, most stable option for a very, very large codebase.
e.g.
is it better to first upgrade ruby to 2.4 , then 2.5 and so on, and then come back around to upgrading rails in small steps (e.g. 4.2 => 5.0.x => 5.1.x => ...) ?
what ruby version is the latest version that can be used to run rails 4.2.x ?
any recommendations / guidance would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一步是确保您的应用程序具有足够的测试,可以在升级应用程序时为您提供信心。
然后,您可以启动实际的升级过程。有不同的方法可以做到这一点。我通常建议以较小的步骤更新,而不是一次升级,因为这使得在此过程中解决问题变得更加容易,因为您完全了解Ruby或Ruby在Rails版本上引入了问题。
此外,Rails版本上的每个Ruby都有与它们兼容的一系列红宝石版本,您必须以匹配组合进行更新。
有人建议您首先升级到最低的未成年人和补丁版本,然后再升级到最新的未成年人,例如
5.0.7.2 - > 5.1.0 - > 5.1.7
。但是以我的经验,可以直接更新到下一个次要版本的最新版本,例如5.0.7.2 - > 5.1.7
。我建议使用“ nofollow noreferrer”> ruby and Ruby on Rails On rails Complocation 。这会导致以下升级路径:
请注意,在此答案的最后更新时(2024年11月) ruby 3.1 和仍然获得安全修复。因此,我建议这是最低版本的组合。错误修复仅适用于Ruby 3.2,Ruby在Rails 7.2.x及更高版本上可用。
在每一步中,请咨询“ nofollow noreferrer”>在官方铁路指南中升级Ruby on rails guides 版本。每一步之后,请确保修复可能发生的所有折旧警告。
请记住,还要记住所有其他宝石。我认为,将所有宝石更新为最新版本是一种很好的做法,这些版本与您当前的Ruby和Ruby在Rails组合之后和在进行下一个升级步骤之前的轨道组合。
The first step is to make sure that your application has enough tests to give you confidence during upgrading the application.
Then you can start the actual upgrade process. There are different ways to do this. I usually suggest updating in smaller steps, instead of huge all in once upgrades, because that makes it much easier to fix issues along the way because you know exactly with Ruby or Ruby on Rails version introduced the issue.
Additionally, each Ruby on Rails version has a range of Ruby versions they are compatible with, and you have to update them in matching combinations.
Some people propose that you should upgrade to the lowest minor and patch version first and then to the latest minor, for example, like
5.0.7.2 -> 5.1.0 -> 5.1.7
. But in my experience, it is fine to update directly to the latest version of the next minor version, like5.0.7.2 -> 5.1.7
.I recommend following this table with Ruby and Ruby on Rails compabilities. This leads to the following upgrade path:
Note that at the time of the last update of this answer (November 2024) Ruby 3.1 and Ruby on Rails 7.1.x still get security fixes. Therefore, I would suggest that to be the lowest version combination to run on production. Bug fixes are only available for Ruby 3.2 and Ruby on Rails 7.2.x and above.
During each step, consult Upgrading Ruby on Rails in the official Rails Guides about what changed in that specific version. After each step, make sure to fix all deprecation warnings that might occur.
Please keep in mind reviewing all your other gems too. I would consider it a good practice to update all gems to the latest versions that are compatible with your current Ruby and Ruby on Rails combination after each step and before making the next upgrade step.