Ruby Environment

Setup

Install Ruby

Install build tools and dependencies.

apt-get -qq update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends \
  build-essential gfortran cmake automake libtool libltdl-dev pkg-config \
  libzmq3-dev libczmq-dev gnuplot-nox libgsl-dev  \
  zlib1g-dev libsqlite3-dev libmagick++-dev imagemagick \
  libatlas-base-dev libncurses5-dev \
  bison libyaml-dev libssl-dev libgdbm-dev libreadline-dev libffi-dev
apt-get clean
rm -r /var/lib/apt/lists/* # Clear package list so it isn't stale

ln -sf /usr/bin/libtoolize /usr/bin/libtool

Download ruby-install.

FILENAME="ruby-install-${RUBYINST_VERSION}.tar.gz"
FILEURL="https://github.com/postmodern/ruby-install/archive/v${RUBYINST_VERSION}.tar.gz"

wget --progress=dot -O /results/$FILENAME $FILEURL
ruby-install-0.7.0.tar.gz

Install ruby-install.

tar -xzvf 
ruby-install-0.7.0.tar.gz
cd ruby-install-${RUBYINST_VERSION}/ sudo make install

Install our version of Ruby.

ruby-install ruby ${RUBY_VERSION}

Link our version to the PATH setting.

ln -fs /opt/rubies/ruby-${RUBY_VERSION}/bin /opt/rubies/

Install Jupyter.

pip install --upgrade jupyter jupyter_client

Update gem list.

gem update --no-document --system

Building sciruby-full fails now, so install the full gem list from it but with no version restrictions. Do rbczmq first because it needs special flags.

CPPFLAGS='-Wno-error=deprecated-declarations' \
  gem install --no-document rbczmq
gem install --no-document \
  ai4r algorithms awesome_print bibsync bibtex-ruby bio classifier-reborn ctioga2 daru darwinning decisiontree distribution extendmatrix gga4r gimuby gnuplot gnuplotrb gruff gsl hamster histogram integration iruby liblinear-ruby measurable mikon minimization nmatrix nyaplot parallel phys-units plotrb pry rb-libsvm rserve-client ruby-fann ruby-minisat rubyvis sciruby statsample statsample-bivariate-extension statsample-glm statsample-timeseries tioga unit \
  narray # added for gsl
iruby register
du -hsx /
jupyter kernelspec list

Test

class Hello
  def initialize(greet)
    @greet = greet
  end
  def say()
    puts "Hello, #{@greet}"
  end
end

Hello.new("world").say()