Jupyter + Rails

Jupyter notebooks are a great alternative to the Rails console for building predictive models. Here’s how to get setup:

First, install Jupyter Notebook and ZeroMQ. With Homebrew, use:

brew install jupyter zeromq

Add to your Gemfile

group :development do
  gem 'iruby'
  gem 'ffi-rzmq'


iruby register --force

Start Jupyter

jupyter notebook

Create a notebook and add to the top

require "./config/environment"

If not at Rails root, use Dir.chdir("path/to/root") { require "./config/environment" }

And science away


Published June 19, 2018 · Tweet

You might also enjoy

Rails on Heroku

navigator.sendBeacon and Rails

Modern Encryption for Rails

All code examples are public domain.
Use them however you’d like (licensed under CC0).