torhve / weechat-matrix-protocol-script

A WeeChat script in Lua that implements the matrix.org chat protocol
349 stars 52 forks source link

Unable to run the script in Fedora 25 #65

Open Rat-S opened 7 years ago

Rat-S commented 7 years ago

Hello, I have weechat v 1.6 and Lua 5.3.4 on fedora 25. When I attempt to run the matrix lua script, I get the error as

lua: loading script "/home/fedora/.weechat/lua/weechat-matrix-protocol-script/matrix.lua" lua: unable to execute file "/home/fedora/.weechat/lua/weechat-matrix-protocol-script/matrix.lua" lua: error: /home/fedora/.weechat/lua/weechat-matrix-protocol-script/matrix.lua:46: module 'cjson' not found: no field package.preload['cjson'] no file '/usr/share/lua/5.3/cjson.lua' no file '/usr/share/lua/5.3/cjson/init.lua' no file '/usr/lib64/lua/5.3/cjson.lua' no file '/usr/lib64/lua/5.3/cjson/init.lua' no file './cjson.lua' no file './cjson/init.lua' no file '/usr/lib64/lua/5.3/cjson.so' no file '/usr/lib64/lua/5.3/loadall.so' no file './cjson.so'

But I have installed lua-cjson already.

Any help would be appreciated. Thanks.

BostonEnginerd commented 7 years ago

lua-cjson is not in the Fedora package archives for some reason. I installed the library using luarocks and it seems to wor OK. I'm getting a lot of CPU usage for some reason though.

jpitchardu commented 7 years ago

Yup same here

sudo dnf install lua-devel.$(uname -p) luarocks
sudo luarocks install lua-cjson

That should fix the problem

jungle-boogie commented 7 years ago

You might need to download cjson and have it compile for lua5.3. On FreeBSD, I had to do this, but it's a very simple install. https://github.com/mpx/lua-cjson/blob/master/Makefile

bradyt commented 7 years ago

I get the exact same error if I build weechat with the suggested liblua5.3-dev as listed here: https://weechat.org/files/doc/stable/weechat_user.en.html#dependencies. If I remove liblua5.3-dev, install liblua5.1-0-dev and rebuild weechat, the plugin succeeds.

5chdn commented 7 years ago

Same issue on Ubuntu 17.4

WeeChat 1.7 (C) 2003-2017 - https://weechat.org/
10:23:13     |   ___       __         ______________        _____ 
10:23:13     |   __ |     / /___________  ____/__  /_______ __  /_
10:23:13     |   __ | /| / /_  _ \  _ \  /    __  __ \  __ `/  __/
10:23:13     |   __ |/ |/ / /  __/  __/ /___  _  / / / /_/ // /_  
10:23:13     |   ____/|__/  \___/\___/\____/  /_/ /_/\__,_/ \__/  
10:23:13     | WeeChat 1.7 [compiled on Apr 26 2017 18:10:49]
10:23:13     | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
10:23:13 =!= | lua: unable to execute file "/home/user/.weechat/lua/autoload/matrix.lua"
10:23:13 =!= | lua: error: /home/user/.weechat/lua/autoload/matrix.lua:46: module 'cjson' not found:
10:23:13     | no field package.preload['cjson']
10:23:13     | no file './cjson.lua'
10:23:13     | no file '/usr/local/share/lua/5.1/cjson.lua'
10:23:13     | no file '/usr/local/share/lua/5.1/cjson/init.lua'
10:23:13     | no file '/usr/local/lib/lua/5.1/cjson.lua'
10:23:13     | no file '/usr/local/lib/lua/5.1/cjson/init.lua'
10:23:13     | no file '/usr/share/lua/5.1/cjson.lua'
10:23:13     | no file '/usr/share/lua/5.1/cjson/init.lua'
10:23:13     | no file './cjson.so'
10:23:13     | no file '/usr/local/lib/lua/5.1/cjson.so'
10:23:13     | no file '/usr/lib/x86_64-linux-gnu/lua/5.1/cjson.so'
10:23:13     | no file '/usr/lib/lua/5.1/cjson.so'
10:23:13     | no file '/usr/local/lib/lua/5.1/loadall.so'
10:23:13     | Plugins loaded: alias, aspell, charset, exec, fifo, guile, irc, javascript, logger, lua, perl, python, relay, ruby, script, tcl, trigger, xfer

Edit, installing lua-cjson-dev fixed this. needs documentation :)

ywecur commented 7 years ago

Same issue on Arch. lua-cjson isn't part of the lua package.

almereyda commented 7 years ago

@picardoJ's comment also works for Fedora 26, despite it installs a package for f25. It was not neccessary for me to install the lua-devel package.

fuzzy76 commented 7 years ago

Same issue on OS X. No packages available in homebrew. :-/

erdnaxeli commented 7 years ago

Guys, there is a README:

brew install lua
luarocks install lua-cjson
brew install weechat --with-lua
fuzzy76 commented 7 years ago

Terribly sorry, did not read the entire readme, only the generic instructions. :-/