title: Failing to build Ruby 2.5.0 with rbenv and ruby-build on macOS Sierra
body: <p>I tried to install ruby 2.5.0 with rbenv and ruby-build on macOS Sierra, but it failed and I got error messages as below:</p>
  
  <pre><code>$ rbenv install 2.5.0
  Downloading openssl-1.1.0g.tar.gz...
  -&gt; https://dqw8nmjcqpjn7.cloudfront.net/de4d501267da39310905cb6dc8c6121f7a2cad45a7707f76df828fe1b85073af
  Installing openssl-1.1.0g...
  Installed openssl-1.1.0g to /Users/hikaru/.rbenv/versions/2.5.0
  
  Downloading ruby-2.5.0.tar.bz2...
  -&gt; https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.0.tar.bz2
  Installing ruby-2.5.0...
  
  BUILD FAILED (OS X 10.12.6 using ruby-build 20171226)
  
  Inspect or clean up the working tree at 
  /var/folders/5q/dy9blchn6fq1_673pm0ybt0h0000gn/T/ruby-
  build.20180102205530.13528
  Results logged to /var/folders/5q/dy9blchn6fq1_673pm0ybt0h0000gn/T/ruby-build.20180102205530.13528.log
  
  Last 10 log lines:
  make[1]: *** Waiting for unfinished jobs....
  installing default ripper libraries
  compiling ancdata.c
  compiling raddrinfo.c
  compiling ifaddr.c
  installing default socket libraries
  linking shared-object zlib.bundle
  linking shared-object socket.bundle
  linking shared-object ripper.bundle
  make: *** [build-ext] Error 2
  </code></pre>
  
  <p>I checked the log files and found the error below:</p>
  
  <pre><code>  ossl_x509cert.c:334:59: error: member reference type 'int' is not a pointer
  if (!i2a_ASN1_OBJECT(out, X509_get0_tbs_sigalg(x509)-&gt;algorithm)) {
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
  </code></pre>
  
  <p>I have no idea why this error happens. I would appreciate it if you would explain how to solve this problem.</p>
  
  <p>After then, I tried to <code>rbenv install 2.5.0</code> with gcc provided by Xcode on macOS High Sierra, and same problem happened.</p>