SciRuby / iruby

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

Update README to tell about zmq installation as the requirement #348

Open dpetruha opened 3 months ago

dpetruha commented 3 months ago

Hello! I tried to install iruby to my local env (running MacOS) and was getting the error below. As appeared I had to install zmq first before installing iruby. Update README document to include zmq installation in Requirements section.

gem install iruby
Building native extensions. This could take a while...
ERROR:  Error installing iruby:
    ERROR: Failed to build gem native extension.

    current directory: /Users/dpetruha/.gem/ruby/3.1.2/gems/iruby-0.8.0/ext
/Users/dpetruha/.rubies/ruby-3.1.2/bin/ruby -rrubygems /Users/dpetruha/.gem/ruby/3.1.2/gems/rake-13.2.1/exe/rake RUBYARCHDIR\=/Users/dpetruha/.gem/ruby/3.1.2/extensions/arm64-darwin-21/3.1.0/iruby-0.8.0 RUBYLIBDIR\=/Users/dpetruha/.gem/ruby/3.1.2/extensions/arm64-darwin-21/3.1.0/iruby-0.8.0
Unable to load this gem. The libzmq library (or DLL) could not be found.
If this is a Windows platform, make sure libzmq.dll is on the PATH.
If the DLL was built with mingw, make sure the other two dependent DLLs,
libgcc_s_sjlj-1.dll and libstdc++6.dll, are also on the PATH.
For non-Windows platforms, make sure libzmq is located in this search path:
["/Users/dpetruha/.gem/ruby/3.1.2/gems/ffi-rzmq-core-1.0.7/lib/ffi-rzmq-core/../../ext/libzmq.dylib", "/usr/local/opt/mysql-client/bin/libzmq.dylib", "/Users/dpetruha/.gem/ruby/3.1.2/bin/libzmq.dylib", "/Users/dpetruha/.rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/bin/libzmq.dylib", "/Users/dpetruha/.rubies/ruby-3.1.2/bin/libzmq.dylib", "/Applications/IntelliJ IDEA 2024.2 EAP.app/Contents/MacOS/libzmq.dylib", "/usr/local/opt/mysql-client/bin/libzmq.dylib", "/opt/homebrew/anaconda3/bin/libzmq.dylib", "/opt/homebrew/anaconda3/condabin/libzmq.dylib", "/usr/local/opt/mysql-client/bin/libzmq.dylib", "/Users/dpetruha/.nvm/versions/node/v20.15.0/bin/libzmq.dylib", "/opt/homebrew/bin/libzmq.dylib", "/opt/homebrew/sbin/libzmq.dylib", "/usr/local/bin/libzmq.dylib", "/System/Cryptexes/App/usr/bin/libzmq.dylib", "/usr/bin/libzmq.dylib", "/bin/libzmq.dylib", "/usr/sbin/libzmq.dylib", "/sbin/libzmq.dylib", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/libzmq.dylib", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/libzmq.dylib", "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/libzmq.dylib", "/Library/Apple/usr/bin/libzmq.dylib", "/Applications/iTerm.app/Contents/Resources/utilities/libzmq.dylib", "/Users/dpetruha/.rubies/ruby-3.1.2/lib/libzmq.dylib", "/usr/local/lib/libzmq.dylib", "/opt/local/lib/libzmq.dylib", "/opt/homebrew/lib/libzmq.dylib", "/usr/lib64/libzmq.dylib"]
rake aborted!
Failed to install ZeroMQ
kojix2 commented 3 months ago

Hi @dpetruha,

Thank you for your message.

The README.md file around version v0.7.3 had this explanation. From version v0.7.4, we added the native-package-installer. This automatically installs the required zeromq libraries for each platform when you install the iruby gem.

https://github.com/SciRuby/iruby/blob/fe16c1b6de2463d5c5552dd64b0645bf930b5834/ext/Rakefile#L10-L15

On macOS, the zmq package is expected to be installed automatically by Homebrew. However, this may not work in some cases. The last update was made three years ago, so it might not work well now. Please let me know your OS version. If you have any ideas for a pull request, please send them.