I am all new to Lua and try to do a simple HTTP-request.
Thats what I started with.
<code>local http=require'socket.http'
print "hello world"
</code>
<code>local http=require'socket.http'
print "hello world"
</code>
local http=require'socket.http'
print "hello world"
and hit it with
<code>lua test.lua
</code>
<code>lua test.lua
</code>
lua test.lua
Response was an error for finding the module for HTTP.
<code>lua: test.lua:1: module 'socket.http' not found:
no field package.preload['socket.http']
no file '/usr/local/share/lua/5.4/socket/http.lua'
no file '/usr/local/share/lua/5.4/socket/http/init.lua'
no file '/usr/local/lib/lua/5.4/socket/http.lua'
no file '/usr/local/lib/lua/5.4/socket/http/init.lua'
no file '/usr/share/lua/5.4/socket/http.lua'
no file '/usr/share/lua/5.4/socket/http/init.lua'
no file './socket/http.lua'
no file './socket/http/init.lua'
no file '/usr/local/lib/lua/5.4/socket/http.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.4/socket/http.so'
no file '/usr/lib/lua/5.4/socket/http.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './socket/http.so'
no file '/usr/local/lib/lua/5.4/socket.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.4/socket.so'
no file '/usr/lib/lua/5.4/socket.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './socket.so'
stack traceback:
[C]: in function 'require'
test.lua:1: in main chunk
[C]: in ?
</code>
<code>lua: test.lua:1: module 'socket.http' not found:
no field package.preload['socket.http']
no file '/usr/local/share/lua/5.4/socket/http.lua'
no file '/usr/local/share/lua/5.4/socket/http/init.lua'
no file '/usr/local/lib/lua/5.4/socket/http.lua'
no file '/usr/local/lib/lua/5.4/socket/http/init.lua'
no file '/usr/share/lua/5.4/socket/http.lua'
no file '/usr/share/lua/5.4/socket/http/init.lua'
no file './socket/http.lua'
no file './socket/http/init.lua'
no file '/usr/local/lib/lua/5.4/socket/http.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.4/socket/http.so'
no file '/usr/lib/lua/5.4/socket/http.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './socket/http.so'
no file '/usr/local/lib/lua/5.4/socket.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.4/socket.so'
no file '/usr/lib/lua/5.4/socket.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './socket.so'
stack traceback:
[C]: in function 'require'
test.lua:1: in main chunk
[C]: in ?
</code>
lua: test.lua:1: module 'socket.http' not found:
no field package.preload['socket.http']
no file '/usr/local/share/lua/5.4/socket/http.lua'
no file '/usr/local/share/lua/5.4/socket/http/init.lua'
no file '/usr/local/lib/lua/5.4/socket/http.lua'
no file '/usr/local/lib/lua/5.4/socket/http/init.lua'
no file '/usr/share/lua/5.4/socket/http.lua'
no file '/usr/share/lua/5.4/socket/http/init.lua'
no file './socket/http.lua'
no file './socket/http/init.lua'
no file '/usr/local/lib/lua/5.4/socket/http.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.4/socket/http.so'
no file '/usr/lib/lua/5.4/socket/http.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './socket/http.so'
no file '/usr/local/lib/lua/5.4/socket.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.4/socket.so'
no file '/usr/lib/lua/5.4/socket.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './socket.so'
stack traceback:
[C]: in function 'require'
test.lua:1: in main chunk
[C]: in ?
All I did was to install package lua5.4 on a Debian 12.
I do not know the module concept of Lua.
Do I miss a package to install or do I need to set some sort of path or what??
I did not find a socket.so on my disk at all.
Thanks for help.