简体   繁体   English

在Mountain Lion上安装zmq gem

[英]Installing zmq gem on Mountain Lion

Installed zmq via homebrew. 通过自制软件安装zmq。

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 . 问题是当前的gem不能与3.xx一起使用
You can however install ZeroMQ 2.2.0 with brew install zeromq22 , the gem will install just fine after that. 但是你可以用brew install zeromq22安装ZeroMQ 2.2.0,之后gem会安装得很好。

Without the ZeroMQ system library, the zmq gem has no hope of compiling. 没有ZeroMQ系统库, zmq gem就没有编译的希望。 If you're using Homebrew, this is an easy process, though: 如果您使用的是Homebrew,这是一个简单的过程:

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. 如果你已经完成了但是找不到它,那么你的编译器可能找不到ZeroMQ库。 You'll want to look for it with find /usr -name 'libzmq*' and see where it's hiding. 你会想用find /usr -name 'libzmq*'来查找它,看看它藏在哪里。 It might be in another directory than /usr/local/lib . 它可能位于/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. 除了--with-zmq-dir=/usr/local ,还可以尝试添加--with-zmq-lib=/usr/local/lib--with-zmq-include=/usr/local/include到你的gem install命令。 Normally just --with-zmq-dir should suffice, but that doesn't seem to be the case with this gem. 通常只需--with-zmq-dir就足够了,但这个宝石的情况似乎并非如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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