CircleCI Doesn't Recognize Pinning Syntax for Ruby Engine Version

While this doesn’t prevent a build, as of Bundler 1.11 (I think, but certainly as of the most recent version 1.12.x), the version pinning syntax is allowed in the ruby statement of the Gemfile. Example:

ruby '~> 2.3.0', :engine => 'ruby', :engine_version => '~> 2.3.0'

Updating bundler in machine -> post handles any errors, but we still have to manually specify the most recent ruby 2.3.x in machine -> ruby -> version since CircleCI doesn’t auto-detect the ruby version properly, giving the following error message:

Unknown ruby interpreter version (do not know how to handle): ~>2.3.0,:engine=>ruby,:engine_version=>~>2.3.0.

I got this to work, perhaps you can check your circle.yml and Gemfile against mine?

# Gemfile
source 'https://rubygems.org'

#ruby '2.3'
ruby '~> 2.3.1', :engine => 'ruby', :engine_version => '~> 2.3.1'

and

# circle.yml
machine:
  ruby:
    version: "2.3"

Also, I am using bundler v1.12.5.

1 Like

Just FYI: Here in 2017 this is still an issue.

My gem file looks like this:

source 'https://rubygems.org'
ruby "~> 2.3.1"

This syntax is valid for bundler, so I think it may be a bug in circle’s Gemfile processor.

I was able to resolve it using the example circle.yml you specified.

# circle.yml
machine:
  ruby:
    version: "2.3"

Thanks for the help!