Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'<path to proj>/.ipython/kernels/ruby': No such file or directory task error #75

Open
schperplata opened this issue Aug 21, 2024 · 0 comments

Comments

@schperplata
Copy link

Hey,
looks like :install_kernels task (lib/jupyter_on_rails/railtie/jupyter.rake) has some default that is not the same on my installation.

$ rails jupyter:notebook
/home/domen/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/io-event-1.4.0/lib/io/event/support.rb:27: warning: IO::Buffer is experimental and both the Ruby and C interface may change in the future!
JUPYTER_DATA_DIR=<path to proj>/.ipython bundle exec iruby register --force
EXECUTE: jupyter kernelspec install --name=ruby3 --user /tmp/iruby_kernel20240821-126386-gxplqt/ruby3
[InstallKernelSpec] Removing existing kernelspec in <path to proj>/.ipython/kernels/ruby3
[InstallKernelSpec] Installed kernelspec ruby3 in <path to proj>/.ipython/kernels/ruby3
rm -rf <path to proj>/.ipython/kernels/rails
cp -r <path to proj>/.ipython/kernels/ruby <path to proj>/.ipython/kernels/rails
cp: cannot stat '<path to proj>/.ipython/kernels/ruby': No such file or directory
bin/rails aborted!
Command failed with status (1): [cp -r <path to proj>/.ipython/kernels/ruby <path to proj>/.ipython/kernels/rails]

Tasks: TOP => jupyter:notebook => jupyter:install_kernels
(See full trace by running task with --trace)

To make this gem work with my installation and Rails, I needed to change line 54 to use ruby3, not ruby:
sh "cp -r #{Shellwords.shellescape(ipython_dir.to_s)}/kernels/ruby #{Shellwords.shellescape(ipython_dir.to_s)}/kernels/#{cfg.kernel_name}"
to:
sh "cp -r #{Shellwords.shellescape(ipython_dir.to_s)}/kernels/ruby3 #{Shellwords.shellescape(ipython_dir.to_s)}/kernels/#{cfg.kernel_name}"

Info:

  • Rails 7.1.3.2
  • ruby 3.2.4 (2024-04-23 revision af471c0e01) [x86_64-linux]

Let me know if there is anything missing. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant