“module 'socket.http' not found:” --Lua on iMac [closed]
Asked Answered
D

2

10

When I run my code in 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 led me to look into LuaSocket, but I still have no idea on what to do or how I would install that.

Debug answered 10/5, 2013 at 21:45 Comment(0)
Q
14

There are several places where a guide to install LuaSocket is available. Some of them are listed as follows:

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

luarocks install luasocket
Quathlamba answered 11/5, 2013 at 0:3 Comment(0)
R
1

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

There are similar options: --with-lua-bin --with-lua-include You can use any of these but make sure the desired directory structure is available in the directory you have mentioned!

Rightminded answered 13/2, 2017 at 7:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.