Install SciRuby failed on OS X

638 Views Asked by At

I have gcc6.1 installed on OS X via brew, when I tried to install sciruby-full on my Mac, always got this Error:

>Fetching: nmatrix-0.1.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing sciruby-full:
    ERROR: Failed to build gem native extension.

    /usr/local/opt/ruby/bin/ruby -r ./siteconf20150627-98945-1pk3go6.rb extconf.rb
checking for apparent GNU g++ binary with C++0x/C++11 support... Exception `RuntimeError' at extconf.rb:144 - You need a version of g++ which supports -std=c++0x or -std=c++11. If you're on a Mac and using Homebrew, we recommend using mac-brew-gcc.sh to install a more recent g++.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/Cellar/ruby/2.2.2/bin/$(RUBY_BASE_NAME)
extconf.rb:144:in `<main>': You need a version of g++ which supports -std=c++0x or -std=c++11. If you're on a Mac and using Homebrew, we recommend using mac-brew-gcc.sh to install a more recent g++. (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.2.0/gems/nmatrix-0.1.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/nmatrix-0.1.0/gem_make.out

My ruby and OS X is always the newest: Ruby 2.2.2 on updated Yosemite.

2

There are 2 best solutions below

4
On

From your error message:

extconf.rb:144:in `': You need a version of g++ which supports -std=c++0x or -std=c++11. If you're on a Mac and using Homebrew, we recommend using mac-brew-gcc.sh to install a more recent g++. (RuntimeError)

1
On

Do the following (using homebrew)

brew tap homebrew/versions
brew install gcc48

if this does not work, try gcc47 or gcc46.

Note: It make take a while to build. gcc is quite large.