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

我可以在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'

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...