在Gemfile中设置红宝石版本

编程入门 行业动态 更新时间:2024-10-27 09:42:47
本文介绍了在Gemfile中设置红宝石版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我可以在 Gemfile 中设置红宝石版本,如下所示:

I can set ruby version in Gemfile as follows:

ruby '2.0.0'

但是如果我想将特定版本设为 2.0.0-p353 ?

But what if I want to have a particular version as 2.0.0-p353?

当我将其添加到 Gemfile 时,我得到:

When I add it to Gemfile, I get:

Your Ruby version is 2.0.0, but your `Gemfile` specified 2.0.0-p353

是否甚至可以设置特定版本?

Is it even possible to set a particular version?

推荐答案

在Bundler的1.3版或更早版本中,无法指定补丁程序级别 :

In Version 1.3 and earlier of Bundler you couldn’t specify the patchlevel:

ruby​​ 指令显式地排除了指定补丁程序级别的能力。 Ruby修补程序通常包含重要的错误和安全修复程序,并且兼容性极强。

The ruby directive explicitly leaves out the ability to specify a patch level. Ruby patches often include important bug and security fixes and are extremely compatible.

此版本在版本1.5中已更改,文档现在说:

This changed in version 1.5, the docs now say:

在 ruby​​ 指令,:patchlevel 是可选的,因为修补程序级别的发行版通常是兼容的,并且包含重要的安全修复程序。 patchlevel选项检查 RUBY_PATCHLEVEL 常量,如果未指定常量,则捆绑程序将忽略它。

In the ruby directive, :patchlevel is optional, as patchlevel releases are usually compatible and include important security fixes. The patchlevel option checks the RUBY_PATCHLEVEL constant, and if not specified then bundler will simply ignore it.

因此您可以这样指定补丁级别:

So you can specify the patchlevel like this:

ruby '2.0.0', :patchlevel => '353'

更多推荐

在Gemfile中设置红宝石版本

本文发布于:2023-10-26 20:39:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531284.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:红宝石   版本   Gemfile

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!