ZeroMQ gem не удается установить на macOS Catalina - PullRequest
0 голосов
/ 05 марта 2020

Я пытаюсь установить и использовать gem zeroMQ на macOS 10.15.3. Но я получаю ошибку сборки, см. Последний фрагмент кода. Я устанавливаю, используя 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"

Но установка gem zeroMQ не удалась. Что я нахожу странным, так это то, что и raw C zeroMQ, cppzmq, и я могли без проблем установить zeroMQ для python, используя PIP. 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.

Ответы [ 2 ]

1 голос
/ 05 марта 2020

Драгоценный камень zmq очень старый: https://rubygems.org/gems/zmq - последнее обновление было выполнено в 2010 году. Существует множество известных проблем совместимости, см., Например: https://github.com/zeromq/rbzmq/issues/32.

Я бы порекомендовал вместо этого использовать gem rbczmq: https://github.com/methodmissing/rbczmq

0 голосов
/ 17 марта 2020

У меня не было проблем с запуском ffi-rzmq.

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

gem install ffi-rzmq
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...