rbenv install 2.5.1をした時に下エラーが発生しました。
環境はMacのHigh Sierraです。
BUILD FAILED (OS X 10.13.4 using ruby-build 20180424) Inspect or clean up the working tree at /var/folders/d3/wr7y5r3j0jn_y6q0p1524pnr0000gp/T/ruby-build.20180517105947.5143 Results logged to /var/folders/d3/wr7y5r3j0jn_y6q0p1524pnr0000gp/T/ruby-build.20180517105947.5143.log Last 10 log lines: tool/config.guess already exists tool/config.sub already exists checking build system type... x86_64-apple-darwin17.5.0 checking host system type... x86_64-apple-darwin17.5.0 checking target system type... x86_64-apple-darwin17.5.0 checking whether the C compiler works... no configure: error: in `/var/folders/d3/wr7y5r3j0jn_y6q0p1524pnr0000gp/T/ruby-build.20180517105947.5143/ruby-2.5.1': configure: error: C compiler cannot create executables See `config.log' for more details make: *** No targets specified and no makefile found. Stop.
下のようにgccの場所を指定する事で解消しました。
CC=/usr/bin/gcc rbenv install 2.5.1