Skip to content
This repository

Tools for scientific computation in Ruby/Rails

branch: master
Octocat-spinner-32 bin Added static/, fixed load path in sciruby-plotter March 25, 2013
Octocat-spinner-32 data Cleaned up Data access. September 29, 2011
Octocat-spinner-32 lib Make a copy of the image page dimensions rather than using a reference December 01, 2011
Octocat-spinner-32 samples Guardian datasets loading with a sample. September 21, 2011
Octocat-spinner-32 spec adding rspec and first numarray_spec doc August 18, 2011
Octocat-spinner-32 static Added static/, fixed load path in sciruby-plotter March 25, 2013
Octocat-spinner-32 .autotest Created initial sciruby gem with unit tests. January 31, 2011
Octocat-spinner-32 .gitignore Added RubyMine files to .gitignore August 23, 2011
Octocat-spinner-32 .rspec Removed deprecated options from .rspec March 25, 2013
Octocat-spinner-32 Improved the README, added file March 23, 2013
Octocat-spinner-32 Gemfile Added `create_write_data` function to Plotter which allows saving to … November 17, 2011
Octocat-spinner-32 Gemfile.lock Added static/, fixed load path in sciruby-plotter March 25, 2013
Octocat-spinner-32 History.txt Removed test/ and static/ directories March 22, 2013
Octocat-spinner-32 LICENSE.txt License and doc updates. As of this commit, SciRuby is under the BSD … November 17, 2011
Octocat-spinner-32 Manifest.txt configured Hoe to look for REAME.rdoc rather than README.txt (and fix… November 30, 2011
Octocat-spinner-32 README.rdoc Added additional links to NMatrix clarifying that it's our main proje… April 28, 2013
Octocat-spinner-32 Rakefile Improved the README, added file March 23, 2013
Octocat-spinner-32 sciruby.gemspec Removed test/ and static/ directories March 22, 2013


Tools for Scientific Computing in Ruby


Ruby has for some time had no equivalent to the beautifully constructed numpy, scipy, and matplotlib libraries for Python. We believe that the time for a Ruby science and visualization package has come and gone. Sometimes when a solution of sugar and water becomes super-saturated, from it precipitates a pure, delicious, and diabetes-inducing crystal of sweetness, induced by no more than the tap of a finger. So it is, we believe, with the need for numeric and visualization libraries in Ruby.

We are not the first with this idea, but we are trying to bring it to life.

A note about repositories

Most of the work right now is happening in NMatrix. If you want to help out, you should check out either mohawkjohn's or chriswailes' fork of NMatrix, not this one.

Updates only happen in the main repository when a feature becomes stable. The project activity log may be misleading.


  • SciRuby::Plotter - visualization GUI for updating plots as scripts are modified

  • SciRuby::Editor - code editor for modifying rubyvis plot scripts

  • Rubyvis - Protovis plotting in Ruby

  • Statsample - a suite for basic and advanced statistics in Ruby

  • SciRuby::Analysis - domain-specific language (DSL) for hassle-free statistical analysis (originally from Statsample)

  • Minimization algorithms in pure Ruby and using GSL

  • Numeric integration algorithms

  • NMatrix, an experimental linear algebra system for Ruby, with dense and sparse matrices

  • rb-gsl fork replacing NArray with NMatrix


From the command line,

sciruby-plotter my_plot.rb

Or, inside a Ruby shell,

$ require 'sciruby'


For a more complete tutorial, with fixes for the most common errors, read the installation page on our wiki.

There are some libraries and gems you'll need to install before using SciRuby, e.g. green_shoes. If you're in Ubuntu:

sudo apt-get install libgtk2.0-dev libgtksourceview2.0-dev librsvg2-dev libcairo2-dev

Then, you just install sciruby as a gem:

gem install sciruby

You can also optionally get rb-gsl, statistics2, and other useful architecture-specific packages using

gem install statsample-optimization

Note that as of this writing, rb-gsl is incompatible with the 1.15 version of the GSL headers. You should make sure you're using the 1.14 headers.

At the moment, *there's a problem* with this setup: NMatrix is incompatible with the rb-gsl gem, which it makes impossible to use SciRuby as a whole, but you're able to use the subprojects independently. We're working on a fix for it in this repository.


Read the instructions in if you want to help.


Please be aware that SciRuby is in ALPHA status. If you're thinking of using SciRuby to write mission critical code, such as for driving a car or flying a space shuttle, you may wish to choose other software (for now).


Copyright © 2010 - 2013, The Ruby Science Foundation.

All rights reserved.

SciRuby is licensed under the BSD 2-clause license. See LICENSE.txt for details.


Support a SciRuby Fellow:

Something went wrong with that request. Please try again.