Option to not install Ruby

ruby
circle.yml

#1

Is there an option to have CircleCI not install Ruby if .rvmrc, .ruby-version or Gemfile is found? We don’t need Ruby installed and it’s unnecessarily lengthening our run times.


#2

It took me forever to find this, but here’s what you want:

echo 'export rvm_install_on_use_flag=0' >> /home/ubuntu/.rvmrc

https://circleci.com/docs/language-ruby-on-rails/


#3

Thank you @rzane for reporting the fix here!


#4

This option isn’t working for me. We are using Docker, so don’t need Ruby installed. I’ve got the following at the start of our circle.yml:

machine:
  services:
    - docker

dependencies:
  override:
    - echo 'export rvm_install_on_use_flag=0' >> /home/ubuntu/.rvmrc
    - docker info

However when running this, it installs Ruby - which is what this is supposed to prevent:

$ echo 'export rvm_install_on_use_flag=0' >> /home/ubuntu/.rvmrc
ruby-2.4.1 is not installed - installing.
...

#5

This has been working for me.

My circle.yml looks like this.

machine
  pre:
    - echo 'export rvm_install_on_use_flag=0' >> /home/ubuntu/.rvmrc

Putting it in dependencies might be too late in the process.


#6