I want to use Jupyter notebooks as my rails console, exactly like django-extensions allows via shell_plus --notebook
in Django.
Any ideas how to do this?
I saw this post which seems to be explaining how to do what I want, but I don't read Japanese or really understand whats going on here.
Require config/boot
, config/application
then call Rails.application.require_environment!
method.
require 'RAILS_ROOT_PATH/config/boot'
require 'RAILS_ROOT_PATH/config/application'
Rails.application.require_environment!
Today I made a gem to automatically do the things needed for running rails c
on juyter.
https://github.com/Yuki-Inoue/jupyter_on_rails
You add
gem 'jupyter_on_rails'
gem 'ffi-rzmq'
to your Gemfile, bundle install, and execute
rake jupyter:notebook
The opened jupyter should have a kernel named to your Rails app, and it'll automatically load the Rails app on initialization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With