Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos “;模块';socket.http';未找到:”--iMac上的Lua_Macos_Sockets_Lua_Luasocket - Fatal编程技术网

Macos “;模块';socket.http';未找到:”--iMac上的Lua

Macos “;模块';socket.http';未找到:”--iMac上的Lua,macos,sockets,lua,luasocket,Macos,Sockets,Lua,Luasocket,在终端中运行代码时,我收到以下错误/消息: module 'socket.http' not found: no field package.preload['socket.http'] no file '/usr/local/share/lua/5.2/socket/http.lua' no file '/usr/local/share/lua/5.2/socket/http/init.lua' no file '/usr/local/lib/lua/5

在终端中运行代码时,我收到以下错误/消息:

module 'socket.http' not found: 
    no field package.preload['socket.http'] 
    no file '/usr/local/share/lua/5.2/socket/http.lua' 
    no file '/usr/local/share/lua/5.2/socket/http/init.lua' 
    no file '/usr/local/lib/lua/5.2/socket/http.lua' 
    no file '/usr/local/lib/lua/5.2/socket/http/init.lua' 
    no file './socket/http.lua' 
    no file '/usr/local/lib/lua/5.2/socket/http.so' 
    no file '/usr/local/lib/lua/5.2/loadall.so' 
    no file './socket/http.so' 
    no file '/usr/local/lib/lua/5.2/socket.so' 
    no file '/usr/local/lib/lua/5.2/loadall.so' 
    no file './socket.so'

一些资料让我研究了
LuaSocket
,但我仍然不知道该做什么或如何安装它。

有几个地方可以找到安装LuaSocket的指南。其中一些建议如下:

我的首选方法是在终端中安装并使用以下命令:

luarocks install luasocket

还有几点。配置Luarock时,您可能需要指向lua安装目录,例如: /configure--with lua=/opt/lua53/

也有类似的选择: --与卢斌 --与lua包括 您可以使用其中任何一个,但请确保所需的目录结构在您提到的目录中可用