加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 在宝石文件中设置宝石版本

发布时间:2020-12-16 19:59:16 所属栏目:百科 来源:网络整理
导读:我可以在Gemfile中设置 ruby版本,如下所示: ruby '2.0.0' 但是如果我想要一个特定版本为2.0.0-p353怎么办? 当我添加到Gemfile,我得到: Your Ruby version is 2.0.0,but your `Gemfile` specified 2.0.0-p353 甚至可以设置一个特定的版本? 解决方法 在Bun
我可以在Gemfile中设置 ruby版本,如下所示:
ruby '2.0.0'

但是如果我想要一个特定版本为2.0.0-p353怎么办?

当我添加到Gemfile,我得到:

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

甚至可以设置一个特定的版本?

解决方法

在Bundler的版本1.3及更早版本中,您可以使用 couldn’t specify the patchlevel:

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,the docs now say:

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.

所以你可以这样指定patchlevel:

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读