Fixed CI failures with Ruby 2.3 on OSX (#5948)

OSX has deprecated OpenSSL, so we need to install it via Homebrew and
build against that version when we build Ruby.
diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc
index 7bbc12d..6bf2025 100755
--- a/kokoro/macos/prepare_build_macos_rc
+++ b/kokoro/macos/prepare_build_macos_rc
@@ -23,7 +23,7 @@
 source $HOME/.rvm/scripts/rvm
 brew uninstall node icu4c cmake
 brew prune
-brew install gflags gpg gpg2 node pcre ruby cmake
+brew install gflags gpg gpg2 node openssl pcre ruby cmake
 sudo chown -R $(whoami) /usr/local
 brew postinstall node
 
diff --git a/ruby/travis-test.sh b/ruby/travis-test.sh
index 7c89e54..cb53338 100755
--- a/ruby/travis-test.sh
+++ b/ruby/travis-test.sh
@@ -36,8 +36,11 @@
        cd ../ruby/compatibility_tests/v3.0.0 &&
        cp -R ../../lib lib && ./test.sh"
   else
+    # Recent versions of OSX have deprecated OpenSSL, so we have to explicitly
+    # provide a path to the OpenSSL directory installed via Homebrew.
     bash --login -c \
-      "rvm install $version && rvm use $version && \
+      "rvm install $version --with-openssl-dir=`brew --prefix openssl` && \
+       rvm use $version && \
        which ruby && \
        git clean -f && \
        gem install bundler -v 1.17.3 && bundle && \