2016-09-03 Tags: hacking ruby node
I am setting up a new Ubuntu 16.04 dev environment. I wanted to take some notes on my progress. I am trying out chruby after it being highly recommended by the ruby gurus Eric and Zach. A natural place to start would be to get this Jekyll blog running locally. I ran into a few stumbling blocks.
There are many different ways to do this, I chose the method below.
wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz tar xf chruby-0.3.9.tar.gz cd chruby-0.3.9/ sudo make install
source /usr/local/share/chruby/chruby.sh source /usr/local/share/chruby/auto.sh
sudo apt-get install -y build-essential bison zlib1g-dev \ libyaml-dev libssl-dev libgdbm-dev libreadline-dev \ libncurses5-dev libffi-dev
wget http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2 tar xf ruby-2.3.1.tar.bz2 cd ruby-2.3.1/ ./configure --prefix=/opt/rubies/ruby-2.3.1 make sudo make install
chruby 2.3.1 gem install bundle bundle install
Once everything had been installed I tried to start up jekyll, and of course it did not work since I do not yet have node installed.
Since I often work with many different versions of node, I took the opportunity to install nvm rather than the version of node that is available in the Ubuntu repositories.
nvm is a really nice tool for working with various versions of node.
This will install nvm and add the appropriate lines to your
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | bash
~/.bashrcfile in order to load properly.
Install the latest version of node
nvm install node
source ~/.bashrc, alternatively you can open a new terminal and nvm will automatically be sourced since the installer script added the appropriate bits for us.
You can now load jekyll with
jekyll -s. Not only do we have Jekyll running like a charm, we also are ready to work with any version of Ruby or Node with chruby and nvm.