Install luasocket using luarocks

I installed luarocks on my Windows XP system (32 bit) following the instructions available on

http://luarocks.org/en/Installation_instructions_for_Windows

to install luasocket from luarocks I used the command "luarocks install luasocket" on the command line. but ended up with an error:

**Warning: Failed searching manifest: Failed loading manifest: Failed fetching man ifest for http://luarocks.org/repositories/rocks - Error fetching file: Failed d ownloading http://luarocks.org/repositories/rocks/manifest Error: No results matching query were found.** 

therefore, he could not find the luasocket.rock file. I downloaded the luasocket-2.0.2-5.src.rock file from the link:

http://luarocks.org/repositories/rocks/

Now I tried to install this .rock file using the install luarocks luarocks install command "C: \ Documents and Settings \ Ankur_Gupta37 \ Desktop \ LuaRocks \ 2.1 \ lua \ luarocks"

(I put luasocket-2.0.2-5.src.rock in the folder "C: \ Documents and Settings \ Ankur_Gupta37 \ Desktop \ LuaRocks \ 2.1 \ lua \ luarocks \ luasocket-2.0.2-5.src.rock")

but the error ended again:

 **set INCLUDE=C:/Documents and Settings/Ankur_Gupta37/Desktop/LuaRocks/2.1/include ;%INCLUDE% &set LIB=C:/Documents and Settings/Ankur_Gupta37/Desktop/LuaRocks/2.1 ;%LIB% &msbuild /p:"VCBuildAdditionalOptions= /useenv" luasocket.sln &mkdir mime & mkdir socket &cp src/mime.dll mime/core.dll &cp src/socket.dll socket/core.dl l 'msbuild' is not recognized as an internal or external command, operable program or batch file. cp: cannot stat `src/mime.dll': No such file or directory cp: cannot stat `src/socket.dll': No such file or directory Error: Build error: Failed building.** 

any body will tell me the problem and its solution.

+6
source share
2 answers

You can try installing the latest version from git. Current status is 3.0 rc1. This version is compatible with Lua 5.1 / 5.2 for example

 luarocks install https://raw.github.com/diegonehab/luasocket/master/luasocket-scm-0.rockspec 

or

 luarocks install luasocket --only-server=http://luarocks.org/repositories/rocks-scm 

This rocky item works with gcc (MinGW) and with MSVC. If you use MSVC, you must run the luarocks Visual Studio Command Prompt form; if you use MinGW, you must add the path to mingw32-gcc to the% PATH% environment variable.

+7
source

Luasocket seems to have changed its libname output. There is no "socket.so/dll" file (at least on Linux), and instead there is core.so.

This code fixes my similar problems:

 package.loadlib("core.so", "*") local socket = require("socket") 

I assume this might be a mistake when installing lua or luarocks. Comment here if you know more.

-2
source

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


All Articles