Luarocks安装

时间:2016-12-26 10:31:01

标签: lua luarocks

我正在尝试安装从luarocks's official site获得的最新版本的Luarocks。首先,我使用了从LuaForge Lua Binaries project引用的Official Lua site获得的Lua二进制文件。但是安装脚本返回以下错误(由于堆栈溢出限制而拖尾输出):

LuaRocks 2.4.x installer.

========================
== Checking system... ==
========================

Admin privileges available for installing
Looking for Lua interpreter
    checking C:\Programs\Lua
       Found lua.exe, testing it...
Interpreter found, now looking for link libraries...
    checking for C:\Programs\Lua\lua5.3.lib
    checking for C:\Programs\Lua\lua53.lib
    checking for C:\Programs\Lua\lua5.3.dll
    checking for C:\Programs\Lua\lua53.dll
       Found lua53.dll
....................................................
Could not find Lua. See /? for options for specifying the location of Lua, or installing a bundled copy of Lua 5.1.

Failed installing LuaRocks. Run with /? for help.

然后我使用了从Lua - joedf's Builds引用的Official Lua site获得的另一个Lua二进制文件。但是安装脚本返回以下错误(由于堆栈溢出限制而拖尾输出):

LuaRocks 2.4.x installer.

========================
== Checking system... ==
========================

Admin privileges available for installing
Looking for Lua interpreter
    checking C:\Programs\Lua
       Found lua53.exe, testing it...
Interpreter found, now looking for link libraries...
    checking for C:\Programs\Lua\lua5.3.lib
    checking for C:\Programs\Lua\lua53.lib
    checking for C:\Programs\Lua\lua5.3.dll
    checking for C:\Programs\Lua\lua53.dll
       Found lua53.dll
Link library found, now looking for headers...
    checking for C:\Programs\Lua\include\lua\5.3\lua.h
    checking for C:\Programs\Lua\include\lua53\lua.h
    checking for C:\Programs\Lua\include\lua5.3\lua.h
    checking for C:\Programs\Lua\include\lua.h
    checking for C:\Programs\Lua\lua.h
    checking C:\Windows\system32\inetsrv
       Found lua53.exe, testing it...
Interpreter found, now looking for link libraries...
    checking for C:\Programs\Lua\lua5.3.lib
    checking for C:\Programs\Lua\lua53.lib
    checking for C:\Programs\Lua\lua5.3.dll
    checking for C:\Programs\Lua\lua53.dll
       Found lua53.dll
......................................................
Could not find Lua. See /? for options for specifying the location of Lua, or installing a bundled copy of Lua 5.1.

Failed installing LuaRocks. Run with /? for help.

然后我使用了从LuaDist引用的official Lua site获得的另一个Lua二进制文件。它已经包括luarocks,但是旧版本。使用此版本会导致以下错误:Orbit Installation Using Luarocks in Windows。所以,试过安装luarocks的脚本。安装成功,我根据安装程序指令配置了以下变量(由于堆栈溢出限制,拖尾输出):

............................................................ 
============================
== LuaRocks is installed! ==
============================

You may want to add the following elements to your paths;
Lua interpreter;
  PATH     :   C:\Programs\Binaries-LuaDist-batteries-0.9.8-Windows-x86\bin
  PATHEXT  :   .LUA
LuaRocks;
  PATH     :   C:\Program Files (x86)\LuaRocks
  LUA_PATH :   C:\Program Files (x86)\LuaRocks\lua\?.lua;C:\Program Files (x86)\LuaRocks\lua\?\init.lua
Local user rocktree (Note: %APPDATA% is user dependent);
  PATH     :   %APPDATA%\LuaRocks\bin
  LUA_PATH :   %APPDATA%\LuaRocks\share\lua\5.1\?.lua;%APPDATA%\LuaRocks\share\lua\5.1\?\init.lua
  LUA_CPATH:   %APPDATA%\LuaRocks\lib\lua\5.1\?.dll
System rocktree
  PATH     :   c:\programs\binaries-luadist-batteries-0.9.8-windows-x86\\bin
  LUA_PATH :   c:\programs\binaries-luadist-batteries-0.9.8-windows-x86\\share\lua\5.1\?.lua;c:\programs\binaries-luadist-batteries-0.9.8-windows-x86\\share\lua\5.1\?\init.lua
  LUA_CPATH:   c:\programs\binaries-luadist-batteries-0.9.8-windows-x86\\lib\lua\5.1\?.dll

Note that the %APPDATA% element in the paths above is user specific and it MUST
be replaced by its actual value.
For the current user that value is: C:\Users\Banee-Ishaque-K\AppData\Roaming.

但是luarocks命令现在返回

  

windows无法打开此文件

错误,会怎么做?我正在使用Windows 7 64位,并且没有用于Windows手动编译Lua而不是使用二进制文件的Windows编译方法。

1 个答案:

答案 0 :(得分:1)

解决方案是,只需使用CMD行参数/ LUA将Lua安装目录指定为Luarocks安装脚本(INSTALL.bat)文件。在上面的例子中,

C:\Programs\luarocks-2.4.2-win32>install.bat /LUA C:\Programs\Binaries-LuaDist-batteries-0.9.8-Windows-x86 

将成功安装Luarocks。 经测试&使用Lua 5.1 64位以及Luarocks 2.4.2 win32软件包验证Win 7 64位。

安装Luarocks; Lua解释器,链接库,标题和放大器运行时必须存在于系统中。来自 LuaForge Lua Binaries project&的二进制文件。 Lua - joedf's Builds只包含Lua解释器&链接库。这就是前两种方法失败的原因。

LuaDist获得的Lua二进制文件包含Lua解释器,链接库和头;运行时将在大多数用于开发目的的Windows系统中可用(如果没有,我们可以安装匹配(用于将Lua源编译为二进制的版本)来自Microsoft网站的Microsoft Visual C ++ Redistributables)。但是,问题是.. \ Binaries-LuaDist-batteries-0.9.8-Windows-x86 \ bin正在路径中。该文件夹仅包含Lua解释器。链接库和标题是.. \ Binaries-LuaDist-batteries-0.9.8-Windows-x86文件夹。