Ruby kernel in Google Colaboratory.

kojix2

kojix2

Posted on February 1, 2019

Ruby kernel in Google Colaboratory.

Hello. I am a Ruby fan.
I tried running Ruby in Google Colaboratory.

image

Open Google Colaboratory.
Run the following commands.



!apt-get install ruby-dev
!sudo apt install libtool libffi-dev ruby ruby-dev make
!sudo apt install libzmq3-dev libczmq-dev
!gem install ffi-rzmq rake
!gem install specific_install
!gem specific_install https://github.com/SciRuby/iruby
!iruby register


Enter fullscreen mode Exit fullscreen mode

Install your favoirite gems for data science(Optional).



!gem install awesome_print
!gem specific_install https://github.com/SciRuby/daru
!gem specific_install https://github.com/SciRuby/daru-view
!gem install numo-narray
!gem install rumale


Enter fullscreen mode Exit fullscreen mode

Then, Upload a Ruby ipynb into Colab using File -> Upload Notebook.



{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "ruby.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "ruby",
      "display_name": "ruby 2.5.1"
    }
  },
  "cells": [
    {
      "metadata": {
        "id": "BpxZ_k6Qv84W",
        "colab_type": "code",
        "colab": {}
      },
      "cell_type": "code",
      "source": [
        "puts \"hello world\""
      ],
      "execution_count": 0,
      "outputs": []
    }
  ]
}


Enter fullscreen mode Exit fullscreen mode

Now you can run your ruby scripts!

image

have a fun day!

Check if the ruby kernel is registered in jupyter (Python notebook)



jupyter kernelspec list


Enter fullscreen mode Exit fullscreen mode

💖 💪 🙅 🚩
kojix2
kojix2

Posted on February 1, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related