Search code examples
ruby-on-railsrubyenvironmentosx-yosemite

Error installing Ruby 2.3.0 on Yosemite via rbenv


For some reason I can't get ruby 2.3.0 installed via RBENV. I got it to work with RVM though. Let me know if I need to provide further information.

Here's the error I get:

Downloading ruby-2.3.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...

BUILD FAILED (OS X 10.10.5 using ruby-build 20160426)

Inspect or clean up the working tree at /tmp/ruby-build.20160426211028.6622
Results logged to /tmp/ruby-build.20160426211028.6622.log

Last 10 log lines:
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin14.5.0
checking host system type... x86_64-apple-darwin14.5.0
checking target system type... x86_64-apple-darwin14.5.0
checking whether the C compiler works... no
configure: error: in `/tmp/ruby-build.20160426211028.6622/ruby-2.3.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

Solution

  • your system has too strict security policy, so add sudo for the rbenv to give the ability to add executions. So you will like something like:

    sudo rbenv install 2.3.0