关于lua:使用羽扇安装luasocket

Installation of luasocket using luarocks

我按照以下说明在Windows XP(32位)系统中安装了羽绒被

http://luarocks.org/en/Installation_instructions_for_Windows

从luarocks安装luasocket我在命令提示符下使用了命令" luarocks install luasocket"。 但最终出现错误:

1
2
3
4
**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.**

因此它无法找到luasocket.rock文件。 我从链接下载了luasocket-2.0.2-5.src.rock文件:

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

现在,我尝试使用命令luarocks install luarocks install" C
:\ Documents and Settings \ Ankur_Gupta37 \ Desktop \ LuaRocks \ 2.1 \ lua \ luarocks"

(我将luasocket-2.0.2-5.src.rock放在位置" C
:\ Documents and Settings \ Ankur_Gupta37 \ Desktop \ LuaRocks \ 2.1 \ lua \ luarocks \ luasocket-2.0.2-5.src.rock")

但再次以错误告终:

1
2
3
4
5
6
7
8
9
10
**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.**

任何人都会告诉我这个问题及其解决方案。


您可以尝试从git安装最新版本。
当前状态为3.0 rc1。
该版本与Lua 5.1 / 5.2兼容
例如

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

要么

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

该rockspec可与gcc(MinGW)和MSVC一起使用。
如果您使用MSVC,则应该运行表格Visual Studio Command Prompt
如果使用MinGW,则应将mingw32-gcc的路径添加到%PATH%环境变量中。