felipec / notmuch-vim

Text-based mail user agent in vim using notmuch.
Other
87 stars 34 forks source link

Dependency Failure: Ruby bindings broken on Mac OS? #17

Closed rlue closed 6 years ago

rlue commented 7 years ago

I can't get the notmuch ruby bindings to work on Mac OS (El Capitan). So far, I've tried:

Homebrew

$ brew install notmuch

But ruby -e "require 'notmuch'" fails.

per the README

$ git clone --branch=0.15.2 git://notmuchmail.org/git/notmuch ~/notmuch
$ cd ~/notmuch
$ make build notmuch=~/notmuch
...
make: *** No rule to make target `build'.  Stop.

Naturally, ruby -e "require 'notmuch'" still fails.

Current git master

$ git clone git://notmuchmail.org/git/notmuch

Per bindings/ruby/README:

To build the the notmuch ruby extension, run the following commands from the top level notmuch source directory:

% ./configure
% make ruby-bindings

The generic documentation about building notmuch also applies.

./configure fails on dependency zlib >=1.2.5.2 (system is 1.2.5). So, I installed 1.2.8 via rudix.

Now ./configure and make ruby-bindings succeed, but ruby -e "require 'notmuch'" still fails.

Instructions on @cehoffman's fork

Ruby Bindings

Go to notmuch source code, and then 'bindings/ruby':

% ruby extconf.rb
% make
% sudo make install
$ cd bindings/ruby
$ make install
/usr/bin/install -c -m 0755 notmuch.bundle /Users/rlue/.rbenv/versions/2.4.0/lib/ruby/vendor_ruby/2.4.0/x86_64-darwin15

Now ruby -e "require 'notmuch'" throws a different error:

/Users/rlue/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/rlue/.rbenv/versions/2.4.0/lib/ruby/vendor_ruby/2.4.0/x86_64-darwin15/notmuch.bundle, 9): Library not loaded: /usr/local/lib/libnotmuch.5.dylib (LoadError)
  Referenced from: /Users/rlue/.rbenv/versions/2.4.0/lib/ruby/vendor_ruby/2.4.0/x86_64-darwin15/notmuch.bundle
  Reason: image not found - /Users/rlue/.rbenv/versions/2.4.0/lib/ruby/vendor_ruby/2.4.0/x86_64-darwin15/notmuch.bundle
    from /Users/rlue/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'

It appears it's trying to load /usr/local/lib/libnotmuch.5.dylib, which does not exist:

$ ls /usr/local/lib/libnotmuch.*
/usr/local/lib/libnotmuch.4.4.0.dylib
/usr/local/lib/libnotmuch.4.dylib
/usr/local/lib/libnotmuch.dylib

Any suggestions?

m4j commented 6 years ago

This was fixed in Homebrew, see issue Homebrew/homebrew-core#30019. No longer a problem and it works on macOS High Sierra.

m4j commented 6 years ago

Make sure to install notmuch --with-ruby option to get bindings installed:

$ brew install notmuch --with-ruby
pheuberger commented 4 years ago

When I run brew install notmuch --with-ruby it says Error: invalid option: --with-ruby. What am I doing wrong? I made sure homebrew is up-to-date and brew doctor comes back without errors.

poetaman commented 3 years ago

@m4j @felipec I get the same error that @pheuberger mentions. --with-ruby is no longer an option.

felipec commented 3 years ago

@pheuberger @reportaman I don't use Homebrew, but apparently they removed all options: Homebrew/homebrew-core#31510. You need to contact the Homebrew team about a solution.

Possibly a notmuch-ruby formula is needed.