Closed YuGiOhJCJ closed 7 years ago
It looks like your luasocket installation is somehow broken, luasocket can't find a part of itself.
You'll have to find out where luasocket's socket.so
or core.so
file is (probably somewhere like /usr/lib/lua/5.1
) and make sure that its added to Lua's native search path (package.cpath
).
OK, so here is the location of core.so:
$ find /usr/lib64/lua -name "core.so"
/usr/lib64/lua/5.1/mime/core.so
/usr/lib64/lua/5.1/socket/core.so
But there is no socket.so. Is it normal?
And here is the current value of my Lua's native search path (package.cpath):
$ lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> return package.cpath
./?.so;/usr/lib64/lua/5.1/?.so;/usr/lib64/lua/5.1/loadall.so
> ^C
So, what I did is to edit the init.lua file of the irc mod to add this first line:
package.cpath = package.cpath .. ";/usr/lib64/lua/5.1/socket/?.so"
But it does not help. I get the same error. Is it the good way to change my Lua's native search path (package.cpath)?
You should use /usr/lib64/lua/5.1/?.so
instead of /usr/lib64/lua/5.1/socket/?.so
(i.e. provide the path to the root of the Lua lib dir). LuaSocket require
s the module socket.core
, so it should resolve to /usr/lib64/lua/5.1/socket/core.so
. Make those changes in the mod's init.lua
.
From your examples, it seems Minetest is looking for /usr/lib/...
while the standalone Lua interpreter is looking for /usr/lib64/...
; it's possible Minetest is not using the system-wide Lua and is using the bundled one which is using the default paths (i.e. not ones specially configured for your system).
The two things you said were correct.
1) Editing the init.lua file of the irc mod to add this first line solves the problem:
package.cpath = package.cpath .. ";/usr/lib64/lua/5.1/?.so"
2) My Minetest was built with the bundled Lua because LuaJIT was not installed on my system. Rebuilding Minetest after installing LuaJIT on my system solves the problem. Now, Minetest is installed with the system Lua instead of the bundled one. It means that I don't need anymore to edit the init.lua file of the irc mod now because the package.cpath value is correct :)
Problem solved.
Hello,
On Slackware64 14.2, I am using:
And here is what happens:
What am I doing wrong please?
Thank you. Best regards.