简体   繁体   English

为什么我不能随yum安装最新版本的ruby?

[英]Why can't I just install the latest version of ruby with yum?

I am frustrated: I want to yum install ruby and install Ruby 2.4.1 or 2.3.0. 我很沮丧:我想yum install ruby并安装Ruby 2.4.1或2.3.0。 Instead it seems that I have to use RVM or rbenv to get any version after 2.0.0 and both of those tools require some arduous process. 相反,似乎我必须使用RVM或rbenv来获取2.0.0之后的任何版本,并且这两个工具都需要一些艰巨的过程。

Why is this so complicated? 为什么这么复杂? Shouldn't I be able to install Ruby with a single yum command and use '/usr/bin/ruby' like I would '/usr/bin/java'? 我是否应该能够使用单个yum命令安装Ruby并像使用“ / usr / bin / java”那样使用“ / usr / bin / ruby​​”?

Things change between Ruby versions. Ruby版本之间的情况有所不同。 With the release of Ruby 2.4.0, many gems and applications needed to be updated in order to be compatible without breaking, including JSON, Rails, Nokogiri and others. 随着Ruby 2.4.0的发布,需要更新许多gem和应用程序以使其兼容而不中断,包括JSON,Rails,Nokogiri等。

Now, with a OS distribution, people usually expect two things: 现在,对于操作系统发行版,人们通常期望两件事:

  1. relative stability over its release cycle, so, things which worked yesterday continue to work tomorrow 在发布周期内保持相对稳定,因此昨天工作的情况明天继续工作
  2. that all shipped packages are compatible to each other. 所有发货的包装都相互兼容。

If the CentOS maintainers were to upgrade their Ruby version mid-release, they would have to ensure that all other software they ship which depends on Ruby is also compatible with this new version, probably by also updating it. 如果CentOS维护者要升级其Ruby中级版本,他们将必须确保所发行的所有其他依赖Ruby的软件也都与此新版本兼容(可能还通过对其进行更新)。 This leads to a maintenance nightmare since, often, these updates also change features which break the first point of requiring stability. 这导致了维护的噩梦,因为通常,这些更新还会更改功能,从而破坏了要求稳定性的第一点。

Because of that distributions usually ship a single version of Ruby (or Python or Perl) and only fix necessary bugs by backporting the fixes to their versions. 因此,该发行版通常只提供单个版本的Ruby(或Python或Perl),并且仅通过将修补程序反向移植到其版本来修复必要的错误。 Major updates are usually only done with a complete new OS release. 主要更新通常仅使用完整的新OS版本进行。 How often this happens depends on the distribution you use. 这种情况的发生频率取决于您使用的发行版。 CentOS/RHEL tend to be very slow, Debian is so-so, Ubuntu has slower-to-update LTS releases and quicker-to-update regular releases. CentOS / RHEL的运行速度往往很慢,Debian如此,Ubuntu的LTS发行版更新较慢,而常规发行版则更新较快。

In general, you trade stability for bleeding edge. 通常,您将稳定性换成前沿。 And for their base OS, most people running servers tend to favor stability. 对于他们的基本操作系统,大多数运行服务器的人都倾向于稳定性。

To use a newer version of Ruby for your own apps, you can still use rbenv, RVM, or any of the other Ruby installers. 要为自己的应用程序使用更高版本的Ruby,您仍然可以使用rbenv,RVM或任何其他Ruby安装程序。 You can install these custom Ruby versions along the OS version and configure your own applications to use these versions. 您可以将这些自定义Ruby版本与OS版本一起安装,并配置自己的应用程序以使用这些版本。

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

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