Last Updated: February 25, 2016
·
18.28K
· novalagung

Ruby - GSL Error `Failed to build gem native extension`

gem install gsl

ERROR:  Error installing gsl:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
extconf.rb:1: command not found: gsl-config --version
*** 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.

solution :

download gsl from http://ossm.utm.my/gnu/gsl/gsl-1.15.tar.gz. extract. run these command

cd gsl
./configure
make clean
make
sudo make install

and last, reinstall the gem

sudo gem install gsl

note

if error said that ruby need gsl-x.x, then you should download gsl with same or lower version. for example required gsl version is 1.15.3, it's mean that you must download gsl v 1.15.3 or 1.15