zeromq / rbzmq

Ruby binding for 0MQ

Home Page:http://www.zeromq.org/bindings:ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installing zmq gem on mountain lion

skillmatic-co opened this issue · comments

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 help?

brew install zeromq - that is all that should be required.

However, I'm getting further errors when gem install tries to compile rbzmq.c - it seems like there's a weird choice of C standard, with ISO C90 causing problems.

ERROR:  Error installing zmq:
    ERROR: Failed to build gem native extension.

        /Users/cormac/.rbenv/versions/1.9.3-p286/bin/ruby extconf.rb --with-zmq-dir=/usr/local
checking for zmq.h... yes
checking for zmq_init() in -lzmq... yes
Cool, I found your zmq install...
creating Makefile

make
compiling rbzmq.c
rbzmq.c: In function ‘context_initialize’:
rbzmq.c:126: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘poll_add_item’:
rbzmq.c:219: warning: ISO C90 forbids mixed declarations and code
rbzmq.c:232: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘internal_select’:
rbzmq.c:338: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘module_select’:
rbzmq.c:388: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘context_socket’:
rbzmq.c:431: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘socket_getsockopt’:
rbzmq.c:968: error: ‘ZMQ_RECOVERY_IVL_MSEC’ undeclared (first use in this function)
rbzmq.c:968: error: (Each undeclared identifier is reported only once
rbzmq.c:968: error: for each function it appears in.)
rbzmq.c:990: error: ‘ZMQ_HWM’ undeclared (first use in this function)
rbzmq.c:991: error: ‘ZMQ_SWAP’ undeclared (first use in this function)
rbzmq.c:995: error: ‘ZMQ_MCAST_LOOP’ undeclared (first use in this function)
rbzmq.c: In function ‘socket_setsockopt’:
rbzmq.c:1292: error: ‘ZMQ_HWM’ undeclared (first use in this function)
rbzmq.c:1293: error: ‘ZMQ_SWAP’ undeclared (first use in this function)
rbzmq.c:1297: error: ‘ZMQ_MCAST_LOOP’ undeclared (first use in this function)
rbzmq.c:1315: error: ‘ZMQ_RECOVERY_IVL_MSEC’ undeclared (first use in this function)
rbzmq.c: In function ‘socket_bind’:
rbzmq.c:1379: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘socket_connect’:
rbzmq.c:1422: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘zmq_send_blocking’:
rbzmq.c:1443: error: too few arguments to function ‘zmq_send’
rbzmq.c: In function ‘socket_send’:
rbzmq.c:1490: warning: ISO C90 forbids mixed declarations and code
rbzmq.c:1496: warning: ISO C90 forbids mixed declarations and code
rbzmq.c:1517: error: too few arguments to function ‘zmq_send’
rbzmq.c: In function ‘zmq_recv_blocking’:
rbzmq.c:1541: error: too few arguments to function ‘zmq_recv’
rbzmq.c: In function ‘socket_recv’:
rbzmq.c:1580: warning: ISO C90 forbids mixed declarations and code
rbzmq.c:1584: warning: ISO C90 forbids mixed declarations and code
rbzmq.c:1602: error: too few arguments to function ‘zmq_recv’
rbzmq.c:1616: warning: ISO C90 forbids mixed declarations and code
rbzmq.c: In function ‘Init_zmq’:
rbzmq.c:1658: warning: ISO C90 forbids mixed declarations and code
rbzmq.c:1675: error: ‘ZMQ_HWM’ undeclared (first use in this function)
rbzmq.c:1676: error: ‘ZMQ_SWAP’ undeclared (first use in this function)
rbzmq.c:1683: error: ‘ZMQ_MCAST_LOOP’ undeclared (first use in this function)
rbzmq.c:1698: error: ‘ZMQ_RECOVERY_IVL_MSEC’ undeclared (first use in this function)
make: *** [rbzmq.o] Error 1


Gem files will remain installed in /Users/cormac/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/zmq-2.1.4 for inspection.
Results logged to /Users/cormac/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/zmq-2.1.4/./gem_make.out

See issue #25

Seeing the same issue as @cormacrelf. Anyone find a solution to this?