在MacOSX上安装zeromq出现的问题

4

我尝试在MacOSX 10.9.5上使用brew安装zeromq。这是我得到的输出:

==> Downloading http://download.zeromq.org/zeromq-3.2.3.tar.gz
######################################################################## 100.0%
==> Patching
patching file tests/test_disconnect_inproc.cpp
==> ./configure --prefix=/usr/local/Cellar/zeromq/3.2.3
==> make
==> make install
==> Caveats
To install the zmq gem on 10.6 with the system Ruby on a 64-bit machine, 
you may need to do:

ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq
==> Summary
/usr/local/Cellar/zeromq/3.2.3: 54 files, 2.3M, built in 24 seconds

在尝试执行命令(ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq)后,它告诉我无法安装zmq:

Fetching: zmq-2.1.4.gem (100%)
Building native extensions with: '--with-zmq-dir=/usr/local/opt/zeromq'
This could take a while...
ERROR:  Error installing zmq:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-zmq-dir=/usr/local/opt/zeromq
checking for zmq.h... /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
from extconf.rb:23:in `header?'
from extconf.rb:32:in `<main>'


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

有人知道这是什么问题,该如何解决吗?


你安装了开发工具吗?去AppStore下载XCode工具,然后运行 xcode-select --install - Mark Setchell
是的,我已经安装了它们。 - Virginie Blancs
1个回答

0

我在Yosemite上遇到了类似的问题。我使用port安装了zmg

sudo port install zmg

接着:

npm install zmq

并且:

brew uninstall zmq

2
“zmg”这两个用法是有意为之的吗? - Bryce Johnson

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接