简体   繁体   中英

Installing zmq gem on Mountain Lion

Installed zmq via homebrew.

Then tried to run:

$ sudo gem install zmq -- --with-zmq-dir=/usr/local
Building native extensions.  This could take a while...
ERROR:  Error installing zmq:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-zmq-dir=/usr/local
checking for zmq.h... yes
checking for zmq_init() in -lzmq... no
checking for zmq_init() in -lzmq... no
extconf.rb:36: Couldn't find zmq library. try setting --with-zmq-dir=<path> to tell me where it is. (RuntimeError)


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/zmq-2.1.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/zmq-2.1.4/gem_make.out

Any ideas?

The problem is that the current gem does not work with 3.xx .
You can however install ZeroMQ 2.2.0 with brew install zeromq22 , the gem will install just fine after that.

Without the ZeroMQ system library, the zmq gem has no hope of compiling. If you're using Homebrew, this is an easy process, though:

brew install zeromq

If you've already done this but it can't be found, it's possible your compiler is not finding the ZeroMQ library. You'll want to look for it with find /usr -name 'libzmq*' and see where it's hiding. It might be in another directory than /usr/local/lib .

$ brew install zeromq22
$ gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq22

In addition to --with-zmq-dir=/usr/local , try also adding --with-zmq-lib=/usr/local/lib and --with-zmq-include=/usr/local/include to your gem install command. Normally just --with-zmq-dir should suffice, but that doesn't seem to be the case with this gem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM