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包括 您可以使用其中任何一个,但请确保所需的目录结构在您提到的目录中可用