Closed dustingooding closed 12 years ago
Forgive me. I'm still new to Lua.
Apparently I was supposed to use zmq = require"zmq"
, not just require"zmq"
.
And apparently luarocks doesn't support the smart http protocol.
the zhelpers.lua file is located at: https://github.com/imatix/zguide/blob/master/examples/Lua/zhelpers.lua
When running the Lua examples from the guide it is best to download all the *.lua files from this folder: https://github.com/imatix/zguide/blob/master/examples/Lua/
Older releases of lua-zmq had registered the module as the global "zmq". But it seems the Lua community is recommending that module don't create globals and just return a value during initialization.
New code should do: local zmq = require"zmq"
For now I have change lua-zmq to still create a global for the module, until I have time to update the examples in the zmq guide.
When using a "https://" url luarocks doesn't know that it is a git repository. Maybe report this issue to the luarocks mailing list: http://luarocks.org/en/Mailing_list since other people behind firewalls may have the same problem.
LuaRocks should add support for using an http proxy for accessing repositories from behind firewalls: http://stackoverflow.com/questions/128035/how-do-i-pull-from-a-git-repository-through-an-http-proxy
I'm trying to use your Lua bindings for ZMQ, but am not having much luck.
I'm running Ubuntu 11.10 (up to date). I installed ZMQ from the Ubuntu package (
sudo apt-get install libzmq-dev libzmq1
). Then I used the instructions here to install lua-zmq using CMake (as I didn't have luarocks installed, yet). I didn't see any errors during the install.I copy-pasted an example from zeromq.org (http://zguide.zeromq.org/lua:interrupt) but it fails to execute. The example, as written, gives the following output:
Sure enough, "zhelpers.h" is nowhere to be found on my machine. I don't blame lua-zmq for this. So, I comment out the
require"zhelpers"
line and run again.This, I believe is a problem. Lua had no problem with
require"zmq"
, but it did when I attempt to use zmq functionality. What am I missing?For completeness, I installed the Ubuntu package for Lua's Python bindings (sudo apt-get install python-zmq) and attempted running the companion example (http://zguide.zeromq.org/py:interrupt), and I had no trouble. So, this tells me ZMQ is installed correctly and bindings work.
I went to reinstall lua-zmq using Ubuntu's package for luarocks (
sudo apt-get install luarocks
). I used the first instruction (sudo luarocks install https://github.com/Neopallium/lua-zmq/raw/master/rockspecs/lua-zmq-scm-1.rockspec
), but because I'm behind a firewall, I'm unable to use the git:// protocol to access github.com. So, I just downloaded the rockspec, changed the url line:But, even that fails.
I really would like to use your software, but I'm just having the worst luck. Any help?