6

我按照可用的说明在我的 windows xp(32 位)系统中安装了 luarocks

http://luarocks.org/en/Installation_instructions_for_Windows

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

**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"安装这个 .rock 文件

(我将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”)

但又以错误告终:

**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.**

任何人告诉我问题及其解决方案..

4

1 回答 1

8

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

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

或者

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

此 rockspec 适用于 gcc (MinGW) 和 MSVC。如果你使用 MSVC,你应该运行 luarocks 表单Visual Studio Command Prompt ,如果你使用 MinGW,那么你应该将路径添加mingw32-gcc到 %PATH% 环境变量中。

于 2013-08-02T08:24:47.783 回答