I can succesfully install the gsl library in my home directory, but when I try to install the gsl gem I get a big list of errors that I do not understand. I am wondering if
This also works on ubuntu 16.04 LTS and ruby 2.2.2sudo apt-get install libgsl0-dev
which OS are you on?
first you need to install gsl
and gsl-devel
RPMs on your OS as root...
e.g. on Fedora Linux:
sudo yum install -y gsl gsl-devel
then do the gem install gsl
or bundle install
without the gsl-devel package, it will not find the correct C-header files.
You also need to make sure that those header files are installed in a location which is included in either the LD_LIBRARY_PATH, or listed in /etc/ld.so.conf
If you have:
gsl-config --version
) (e.g. in Ubuntu 14.04),Then try https://github.com/siefca/rb-gsl -- it's tweaked for such configuration.
It should also work with Ruby 1.9 and Ruby 2.0.
If you're using bundler to manage gems in a project then put a line in your Gemfile
:
gem 'gsl', :git => 'git://github.com/siefca/rb-gsl'
Cheers!
Attention it seems not working with Ruby 2.1.0.
For Ubuntu 12.04 LTS and Ruby 2.0.0:
cd ~
wget ftp://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz
tar xvzf gsl-1.15.tar.gz
cd gsl-1.15
./configure
make
sudo make install
Check if GSL 1.15 is correctly installed
gsl-config --version
Then install gem (gsl 1.15.3)
gem install gsl
under ubuntu 13.04 this solves the problem:
sudo apt-get install libgsl0-dev
no need to manually install an old version
Ubuntu 11.10 includes a newer version (1.15) of libgsl0 that is not compatible with ruby/gsl :
Must install older version 1.14 for ruby/gsl to work:
curl -O http://mirror.veriportal.com/gnu/gsl/gsl-1.14.tar.gz
tar xvzf gsl-1.14.tar.gz
cd gsl-1.14
./configure
make
sudo make install
sudo gem install --conservative --no-ri --no-rdoc gsl
Installation works OK and test on Ubuntu and Debian Squeeze:
Fetching: narray-0.6.0.1.gem (100%)
Building native extensions. This could take a while...
Fetching: gsl-1.14.7.gem (100%)
Building native extensions. This could take a while...
Successfully installed narray-0.6.0.1
Successfully installed gsl-1.14.7
2 gems installed