From: Cameron McBride Date: 2009-05-08T14:11:30+09:00 Subject: Re: using the GSL library On Thu, May 7, 2009 at 22:59, Jason Lillywhite wrote: > I'm trying to get started with the gsl-ruby library - thought I'd start > with calculating mean of an array. I'm following the example on > http://rb-gsl.rubyforge.org/stats.html. But I run into this: > > require("gsl") > => true > irb(main):002:0> v = Vector[1..7] > NameError: uninitialized constant Vector from (irb):2 I forget exactly when it happened, but the GSL namespace isn't loaded by default in the newer versions of the library. This is a good thing. Your example will work if you type: v = GSL::Vector[1..7] if you really want the short versions, just type include GSL > Isn't Vector in the core?... so I did this > > irb(main):003:0> require 'matrix' > => true > irb(main):004:0> v = Vector[1..7] > => Vector[1..7] be careful here. What you just did was load the std library 'matrix' library, which also defined a Vector constructor - but no method called 'mean' This is very different than GSL. Cameron