Set ruby version in Gemfile

前端 未结 2 500
情深已故
情深已故 2021-02-07 01:32

I can set ruby version in Gemfile as follows:

ruby \'2.0.0\'

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

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-07 01:43

    In Version 1.3 and earlier of Bundler you 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.

    This changed in version 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.

    So you can specify the patchlevel like this:

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

提交回复
热议问题