Мне удалось установить luasocket, и он отлично работает, используя lua5.3, но я не могу найти способ установить их, чтобы требовать от luajit.
Если я пишу print(_VERSION), это показывает, что luajit использует lua5.1.
Это то, что я пытался:
luarocks install luasocket
luarocks --local install luasocket
luarocks --lua-version 5.1 install luasocket
luarocks --lua-version 5.1 --local install luasocket
luarocks config lua_version 5.1
luarocks install luasocket
sock = require("/data/data/com.termux/files/home/.luarocks/lib/luarocks/rocks-5.1/socket")
package.path = package.path .. ";/data/data/com.termux/files/home/.luarocks/lib/luarocks/rocks-5.1" require "socket"
package.path = package.path .. ";/data/data/com.termux/files/home/.luarocks/lib/lua/5.1" require "socket"
...
Ошибка:
$ luajit
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
JIT: ON ARMv7 VFPv3 fold cse dce fwd dse narrow loop abc sink fuse
> sock = require("socket")
stdin:1: module 'socket' not found:
no field package.preload['socket']
no file './socket.lua'
no file '/data/data/com.termux/files/usr/share/luajit-2.1.0-beta3/socket.lua'
no file '/usr/local/share/lua/5.1/socket.lua'
no file '/usr/local/share/lua/5.1/socket/init.lua'
no file '/data/data/com.termux/files/usr/share/lua/5.1/socket.lua'
no file '/data/data/com.termux/files/usr/share/lua/5.1/socket/init.lua'
no file './socket.so'
no file '/usr/local/lib/lua/5.1/socket.so'
no file '/data/data/com.termux/files/usr/lib/lua/5.1/socket.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: at 0xaba4406d
Я попытался переместить установленные файлы по некоторым из этих путей, но все равно не работает.