Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 895
Alex Avatar asked May 10 '13 21:05

Alex


1 Answers

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

  • http://w3.impa.br/~diego/software/luasocket/installation.html
  • https://github.com/diegonehab/luasocket/tree/cvs-diego
  • http://luarocks.org/

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

luarocks install luasocket
like image 175
hjpotter92 Avatar answered Sep 24 '22 15:09

hjpotter92