我可以在 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 theRUBY_PATCHLEVEL
constant, and if not specified then bundler will simply ignore it.
所以你可以像这样指定补丁级别:
ruby '2.0.0', :patchlevel => '353'
关于ruby-on-rails - 在 Gemfile 中设置 ruby 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22427515/