Wrong ruby version installed CircleCi 2

ruby
config

#1

This is the docker image I used:
- image: circleci/ruby:2.3-node-browsers

But it gives me error:
Your Ruby version is 2.3.6, but your Gemfile specified 2.3.0


#2

Hey, have a look at this post as I asked about the versions before: CircleCI Ruby images


#3

I don’t know if there is enough information here to answer your question. What gives you an error? Where do you get it? What config are you using?


#4

I am using version 2.

here’s the first few lines of my .circleci/config.yml:

version: 2
jobs:
  build:
    docker:
      - image: circleci/ruby:2.3-node-browsers

The error was when installing dependencies:
bundle install --jobs=4 --retry=3 --path vendor/bundle
Your Ruby version is 2.3.6, but your Gemfile specified 2.3.0

I ssh into the circleci box and checked versions:

$ ruby -v
ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-linux]

$ whereis ruby
ruby: /usr/local/bin/ruby /usr/local/lib/ruby 
$ ls /usr/local/lib/ruby
2.3.0  gems  site_ruby  vendor_ruby
$ locate 2.3.6
(no result)

$ bundle env
## Environment

```
Bundler       1.16.1
  Platforms   ruby, x86_64-linux
Ruby          2.3.6p384 (2017-12-14 revision 61254) [x86_64-linux]
  Full Path   /usr/local/bin/ruby
  Config Dir  /usr/local/etc
RubyGems      2.7.6
  Gem Home    /usr/local/bundle
  Gem Path    /home/circleci/.gem/ruby/2.3.0:/usr/local/lib/ruby/gems/2.3.0:/usr/local/bundle
  User Path   /home/circleci/.gem/ruby/2.3.0
  Bin Dir     /usr/local/bundle/bin
Tools
  Git         2.1.4
  RVM         not installed
  rbenv       not installed
  chruby      not installed
```

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.7.6
  - RUBY VERSION: 2.3.6 (2017-12-14 patchlevel 384) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/bundle
  - USER INSTALLATION DIRECTORY: /home/circleci/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bundle/bin
  - SPEC CACHE DIRECTORY: /home/circleci/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/bundle
     - /home/circleci/.gem/ruby/2.3.0
     - /usr/local/lib/ruby/gems/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-document"
     - "update" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bundle/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin

Ruby:2.3 image contains ruby 2.3.4 was expecting 2.3.0
#5

how can we install 2.3.0 then? https://circleci.com/docs/2.0/circleci-images/#ruby


#6

Nevermind, I just removed ruby '2.3.0' from Gemfile and now it works.


#7

One other resolution option: the Ruby version will be determined by the Docker container you’re using (check under docker in your .circleci/config.yml). If you’re using, say, circleci/ruby:2.3-node-browsers, the 2.3 here will grab latest, which will currently give you Ruby 2.3.7.

You should be able to pin to a specific tag by specifying the full version you’d like to use (e.g. ruby:2.3.0-node-browsers) instead.


#8

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.