"module" socket.http not found: "--Lua on iMac

When I run my code in the terminal, I get this error / message:

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' 

Some sources made me look into LuaSocket , but I still don't know what to do or how to install it.

+6
source share
2 answers

There are several places where the LuaSocket installation guide is available. Some of them are listed below:

My preferred method would be to install LuaRocks and then use the following command in the terminal:

 luarocks install luasocket 
+7
source

A few more points. When configuring luarocks, you may need to specify the lua installation directory, for example: ./configure --with-lua = / opt / lua53 /

There are similar options: --with-Lua-Ben --with-Lua-include You can use any of them, but make sure that the desired directory structure is available in the directory you specify!

0
source

Source: https://habr.com/ru/post/944743/


All Articles