title: How to change Ruby version for Homebrew in macOS in Travis CI?
body: <p>Trying to run</p>
  
  <pre><code>if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3; fi
  </code></pre>
  
  <p>in <code>before_install</code>, I end up with</p>
  
  <pre><code>/usr/local/Homebrew/Library/Homebrew/brew.rb:12:in \`&lt;main&gt;': Homebrew must be run under Ruby 2.3! (RuntimeError)  
  
  The command "if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3; fi" failed and exited with 1 during .
  
  Your build has been stopped.
  
  /Users/travis/.travis/job_stages: line 166: shell_session_update: command not found  
  </code></pre>
  
  <p>So I assume the issue here is that <code>ruby</code> is on version 2.0, which I confirmed with <code>ruby --version</code>. The funny thing is, my builds just stopped working all of the sudden, without any change to .travis.yml.<br>
  So how do I actually change Ruby versions?</p>
  
  <p>Might be important to not, that before <code>git clone</code> is run I get this:</p>
  
  <pre><code>$ rvm use
  
  Warning! PATH is not properly set up, '/Users/travis/.rvm/gems/ruby-2.0.0-p648/bin' is not at first place,
  
           usually this is caused by shell initialization files - check them for 'PATH=...' entries,
  
           it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
  
           to fix temporarily in this shell session run: 'rvm use ruby-2.0.0-p648'.
  </code></pre>