繁体   English   中英

ZeroMQ gem 无法在 macOS Catalina 上安装

[英]ZeroMQ gem fails to install on macOS Catalina

我正在尝试在 macOS 10.15.3 上安装和使用 zeroMQ gem。 但是我收到一个构建错误,请参阅最后一个代码片段。 我像这样使用 bundle 安装: bundle install --path vendor/bundle和我的 Gemfile 像这样:

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "sinatra"
gem "pg"
gem "zmq"

但是 zeroMQ 的 gem 安装失败。 我觉得奇怪的是,原始 C zeroMQ、cppzmq 和我都可以使用 PIP 为 python 安装 zeroMQ,没有任何问题。 zeroMQ 是使用 Homebrew 安装的。

任何见解都适用。

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4
/Users/larsnielsen/.rbenv/versions/2.6.5/bin/ruby -I /Users/larsnielsen/.rbenv/versions/2.6.5/lib/ruby/2.6.0 -r ./siteconf20200305-37449-pikzw8.rb extconf.rb
checking for zmq.h... yes
checking for zmq_init() in -lzmq... yes
Cool, I found your zmq install...
creating Makefile

current directory: /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4
make "DESTDIR=" clean

current directory: /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4
make "DESTDIR="
compiling rbzmq.c
rbzmq.c:105:12: warning: 'rb_data_object_alloc' is deprecated: by rb_data_object_wrap [-Wdeprecated-declarations]
    return rb_data_object_alloc (class_, NULL, 0, context_free);
           ^
/Users/larsnielsen/.rbenv/versions/2.6.5/include/ruby-2.6.0/ruby/ruby.h:1437:1: note: 'rb_data_object_alloc' has been explicitly marked deprecated here
DEPRECATED_BY(rb_data_object_wrap, static inline VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
^
/Users/larsnielsen/.rbenv/versions/2.6.5/include/ruby-2.6.0/x86_64-darwin19/ruby/config.h:139:44: note: expanded from macro 'DEPRECATED_BY'
#define DEPRECATED_BY(n,x) __attribute__ ((__deprecated__("by "#n))) x
                                           ^
rbzmq.c:324:9: warning: implicit declaration of function 'rb_thread_blocking_region' is invalid in C99 [-Wimplicit-function-declaration]
        rb_thread_blocking_region (zmq_poll_blocking, (void*)&poll_args, NULL, NULL);
        ^
rbzmq.c:968:7: error: use of undeclared identifier 'ZMQ_RECOVERY_IVL_MSEC'
        case ZMQ_RECOVERY_IVL_MSEC:
             ^
rbzmq.c:990:10: error: use of undeclared identifier 'ZMQ_HWM'
    case ZMQ_HWM:
         ^
rbzmq.c:991:10: error: use of undeclared identifier 'ZMQ_SWAP'
    case ZMQ_SWAP:
         ^
rbzmq.c:995:10: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'
    case ZMQ_MCAST_LOOP:
         ^
rbzmq.c:1292:10: error: use of undeclared identifier 'ZMQ_HWM'
    case ZMQ_HWM:
         ^
rbzmq.c:1293:10: error: use of undeclared identifier 'ZMQ_SWAP'
    case ZMQ_SWAP:
         ^
rbzmq.c:1297:10: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'
    case ZMQ_MCAST_LOOP:
         ^
rbzmq.c:1315:10: error: use of undeclared identifier 'ZMQ_RECOVERY_IVL_MSEC'
    case ZMQ_RECOVERY_IVL_MSEC:
         ^
rbzmq.c:1443:81: error: too few arguments to function call, expected 4, have 3
    send_args->rc = zmq_send(send_args->socket, send_args->msg, send_args->flags);
                    ~~~~~~~~                                                    ^
/usr/local/include/zmq.h:489:1: note: 'zmq_send' declared here
ZMQ_EXPORT int zmq_send (void *s_, const void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
                   ^
rbzmq.c:1512:9: warning: implicit declaration of function 'rb_thread_blocking_region' is invalid in C99 [-Wimplicit-function-declaration]
        rb_thread_blocking_region (zmq_send_blocking, (void*) &send_args, NULL, NULL);
        ^
rbzmq.c:1517:38: error: too few arguments to function call, expected 4, have 3
        rc = zmq_send (s, &msg, flags);
             ~~~~~~~~                ^
/usr/local/include/zmq.h:489:1: note: 'zmq_send' declared here
ZMQ_EXPORT int zmq_send (void *s_, const void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
                   ^
rbzmq.c:1541:81: error: too few arguments to function call, expected 4, have 3
    recv_args->rc = zmq_recv(recv_args->socket, recv_args->msg, recv_args->flags);
                    ~~~~~~~~                                                    ^
/usr/local/include/zmq.h:492:1: note: 'zmq_recv' declared here
ZMQ_EXPORT int zmq_recv (void *s_, void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
                   ^
rbzmq.c:1596:9: warning: implicit declaration of function 'rb_thread_blocking_region' is invalid in C99 [-Wimplicit-function-declaration]
        rb_thread_blocking_region (zmq_recv_blocking, (void*) &recv_args,
        ^
rbzmq.c:1602:38: error: too few arguments to function call, expected 4, have 3
        rc = zmq_recv (s, &msg, flags);
             ~~~~~~~~                ^
/usr/local/include/zmq.h:492:1: note: 'zmq_recv' declared here
ZMQ_EXPORT int zmq_recv (void *s_, void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
                   ^
rbzmq.c:1675:50: error: use of undeclared identifier 'ZMQ_HWM'
    rb_define_const (zmq_module, "HWM", INT2NUM (ZMQ_HWM));
                                                 ^
rbzmq.c:1676:51: error: use of undeclared identifier 'ZMQ_SWAP'
    rb_define_const (zmq_module, "SWAP", INT2NUM (ZMQ_SWAP));
                                                  ^
rbzmq.c:1683:57: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'
    rb_define_const (zmq_module, "MCAST_LOOP", INT2NUM (ZMQ_MCAST_LOOP));
                                                        ^
rbzmq.c:1698:64: error: use of undeclared identifier 'ZMQ_RECOVERY_IVL_MSEC'
    rb_define_const (zmq_module, "RECOVERY_IVL_MSEC", INT2NUM (ZMQ_RECOVERY_IVL_MSEC));
                                                               ^
4 warnings and 16 errors generated.
make: *** [rbzmq.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4 for inspection.
Results logged to /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/extensions/x86_64-darwin-19/2.6.0-static/zmq-2.1.4/gem_make.out

An error occurred while installing zmq (2.1.4), and Bundler cannot continue.
Make sure that `gem install zmq -v '2.1.4' --source 'https://rubygems.org/'` succeeds before bundling.

zmq gem 很旧: https : //rubygems.org/gems/zmq - 上次更新是在 2010 年进行的。有许多已知的兼容性问题,例如参见: https : //github.com/zeromq/rbzmq/issues /32

我建议您改用 gem rbczmqhttps : //github.com/methodmissing/rbczmq

让 ffi-rzmq 运行没有问题。

https://github.com/chuckremes/ffi-rzmq

gem install ffi-rzmq

暂无
暂无

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

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