SciRuby / iruby

Official gem repository: Ruby kernel for Jupyter/IPython Notebook
https://github.com/SciRuby/iruby
MIT License
890 stars 27 forks source link

error installing 0.4.0 on Windows #263

Closed MatthewSteen closed 4 years ago

MatthewSteen commented 4 years ago

I'm getting the following error trying to update from 0.3 to 0.4.0 using Ruby 2.2.4 and Windows 10.

$ iruby register --force
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/iruby-0.4.0/lib/iruby/jupyter.rb:35:in `windows_user_appdata': uninitialized constant Module::Fiddle (NameError)
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/iruby-0.4.0/lib/iruby/jupyter.rb:9:in `default_data_dir'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/iruby-0.4.0/lib/iruby/jupyter.rb:26:in `kernelspec_dir'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/iruby-0.4.0/lib/iruby/command.rb:76:in `resolve_kernelspec_dir'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/iruby-0.4.0/lib/iruby/command.rb:12:in `initialize'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/iruby-0.4.0/bin/iruby:5:in `new'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/iruby-0.4.0/bin/iruby:5:in `<top (required)>'
        from C:/Ruby22-x64/bin/iruby:23:in `load'
        from C:/Ruby22-x64/bin/iruby:23:in `<main>'
kojix2 commented 4 years ago

Hi @MatthewSteen Thank you for your report.

This error appears to be caused by not loading the Fiddle module. I added require 'fiddle/import'. If you don't mind, please install it from master and see if the error continues.

gem install specific_install
gem specific_install https://github.com/SciRuby/iruby
iruby register --force
MatthewSteen commented 4 years ago

Thanks @kojix2. I have to use Ruby 2.2.4 so it looks like I can't test.

Also, that minor 😉 piece of info looks like it's missing from the install instructions, namely the minimum Ruby version requirement.

$ gem specific_install https://github.com/SciRuby/iruby
/mingw64/bin/git
Cloning into 'C:/Users/matt/AppData/Local/Temp/d20191208-26560-m6ndwb'...
remote: Enumerating objects: 49, done.
remote: Counting objects: 100% (49/49), done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 2944 (delta 21), reused 22 (delta 9), pack-reused 2895
Receiving objects: 100% (2944/2944), 1.32 MiB | 2.34 MiB/s, done.
Resolving deltas: 100% (1499/1499), done.
WARNING:  open-ended dependency on ffi-rzmq (>= 0) is not recommended
  if ffi-rzmq is semantically versioned, use:
    add_runtime_dependency 'ffi-rzmq', '~> 0'
WARNING:  open-ended dependency on minitest (>= 0, development) is not recommended
  if minitest is semantically versioned, use:
    add_development_dependency 'minitest', '~> 0'
WARNING:  open-ended dependency on pycall (>= 1.2.1, development) is not recommended
  if pycall is semantically versioned, use:
    add_development_dependency 'pycall', '~> 1.2', '>= 1.2.1'
WARNING:  open-ended dependency on rake (>= 0, development) is not recommended
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
ERROR:  While executing gem ... (Gem::RuntimeRequirementNotMetError)
    iruby requires Ruby version >= 2.3.0. The current ruby version is 2.2.0.
http installing from https://github.com/SciRuby/iruby
  Successfully built RubyGem
  Name: iruby
  Version: 0.4.0
  File: iruby-0.4.0.gem
kojix2 commented 4 years ago

Thanks. Ruby 2.2 was recently removed from support, because we don't test iruby on version 2.2. https://github.com/SciRuby/iruby/commit/eb8dc27f374d602d3cc4e7cc29415e4a30db62b9 But it might work without problem.

git clone https://github.com/SciRuby/iruby
git checkout  b4bdd7e4ab6fa0f130b427ba9c10123e35a3b774
rake install
iruby register --force

Also If you don't mind, could you tell me the reason why you have to use ruby 2.2?

MatthewSteen commented 4 years ago

@kojix2 I checked out/installed b4bdd7e4ab6fa0f130b427ba9c10123e35a3b774 and added the require 'fiddle/import' to jupyter.rb.

Seems to be working, although I don't know how to check that Jupyter Lab is running 0.4.0 instead of 0.3.0.

I do whole-building energy simulation for work and regularly use the https://github.com/NREL/OpenStudio Ruby API, which is currently using 2.2.4.

kojix2 commented 4 years ago

Thanks @MatthewSteen MatthewSteen. I didn't know IRuby was used in such a great project. I think the actual use case is important. I'm going to add version 2.2 again. If you need to upgrade your OpenStudio project Ruby version, please let me know.

image

mrkn commented 4 years ago

@MatthewSteen Ruby 2.2 died about two years ago, and Ruby 2.7 will come this month. We must keep IRuby go forward as Ruby evolves. Could you please consider forking IRuby to support Ruby 2.2 by yourself?

MatthewSteen commented 4 years ago

@kojix2 to be clear, IRuby is not used in OpenStudio. It has a Ruby API that I use regularly through IRuby. There may be a few other OpenStudio users that also use IRuby for their workflows, but probably not enough to support Ruby 2.2.4.

@mrkn thanks for the suggestion. I will probably just use IRuby 0.3.0 until OpenStudio updates to a newer version of Ruby, which is hopefully next year.

kojix2 commented 4 years ago

Thanks @mrkn, @MatthewSteen

I was impressed to see the IRuby use case. I don't see many people using IRuby besides me. But the principle is important. My commt was careless this time 🤦.

MatthewSteen commented 4 years ago

@kojix2 so far I'm really just using it for the syntax highlighting and passing of objects between cells that IPython's %%script ruby cell magic doesn't have. At some point I'd like to try some of the other SciRuby libraries. Anyway, thanks for the fix here. Please close when appropriate.