문제

Is there a way to specify a range for ruby version?

ruby '~> 2.1.0'
Your Ruby version is 2.1.1, but your Gemfile specified ~> 2.1.0

ruby '>= 2.1.0'
Your Ruby version is 2.1.1, but your Gemfile specified >= 2.1.0

Obviously, ranges works for gems, but maybe it's not possible for ruby version. Or did I get my syntax wrong?

도움이 되었습니까?

해결책

You can't set a range for the ruby version, see here

Syntax is like so:

ruby 'RUBY_VERSION', :engine => 'ENGINE', :engine_version => 'ENGINE_VERSION', :patchlevel => 'RUBY_PATCHLEVEL'

다른 팁

It is not possible in Bundler 1.x because it cannot be done maintaining backward compatibility with the format of Gemfile.lock.

As discussed there, this is arguably a bad idea unless the lockfile contains the ruby version. Adding the ruby version to the lockfile means Bundler 2 at the earliest.

(from an issue that has been filed requesting the addition of a range feature for Ruby versions)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top