命令 `luarocks config` 给出错误
The command `luarocks config` gives errors
我从这里安装了 luarocks-2.2.1-win32:
https://keplerproject.github.io/luarocks/releases/
而且安装很简单。有一个 .bat 文件可以完成这一切。但不幸的是,下载的岩石无法被LUA识别。我通过发出
检查了我的 LUA 安装
luarocks config
得到这个:
C:\Program Files (x86)\Lua.1\lua: C:\Program Files (x86)\Lua.1\luarocks.lua:3: module 'luarocks.command_line' not found:
no field package.preload['luarocks.command_line']
no file 'C:\Program Files (x86)\LuaRocks.2\lua\luarocks\'
no file 'C:\Program Files (x86)\LuaRocks.2\lua\luarocks\init.lua'
no file 'C:\Program Files (x86)\LuaRocks\systree\share'
no file 'C:\Program Files (x86)\LuaRocks\systree\share\lua.1\luarocks\command_line.lua'
no file 'C:\Program Files (x86)\LuaRocks\systree\share\lua.1\luarocks\command_line\init.lua'
no file 'C:\Program Files (x86)\LuaRocks\systree\share\lua.1'
no file 'C:\Program Files (x86)\LuaRocks\systree\lib\lua.1\luarocks\command_line.dll'
no file 'C:\Users\Stefan\AppData\Roaming\LuaRocks\share\lua.1\luarocks\command_line.lua'
no file 'C:\Users\Stefan\AppData\Roaming\LuaRocks\lib\lua.1\luarocks\command_line.dll'
no file '.\luarocks\command_line.dll'
no file '.\luarocks\command_line51.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks\command_line.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks\command_line51.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks\command_line.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks\command_line51.dll'
no file 'C:\Program Files (x86)\Lua.1\loadall.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\loadall.dll'
no file '.\luarocks.dll'
no file '.\luarocks51.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks51.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks51.dll'
no file 'C:\Program Files (x86)\Lua.1\loadall.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\loadall.dll'
stack traceback:
[C]: in function 'require'
C:\Program Files (x86)\Lua.1\luarocks.lua:3: in main chunk
[C]: ?
有人有将 LUArocks 安装到 windows 的经验吗?
这一行
no file 'C:\Program Files (x86)\LuaRocks.2\lua\luarocks\'
表示您的 LUA_PATH
文件不正确,因为它生成的文件名没有您要查找的模块的名称(通常看起来像 C:\Program Files (x86)\LuaRocks.2\lua\luarocks\command_line.lua
.
在 LUA_PATH
和 LUA_CPATH
变量中,字符 ?
扩展为模块名称,例如,如果 LUA_PATH
是 c:\mymodules\?.lua
,尝试要求模块 foo.bar
将打开 c:\mymodules\foo\bar.lua
.
添加到 LUA_PATH
的路径时,通常会为每个目录添加两个变体,例如假设的 c:\mymodules
:c:\mymodules\?.lua;c:\mymodules\?\init.lua
。当您对 Lua 模块所在的实际目录执行此操作时,Lua 会找到它们。
(不过,由 LuaRocks 安装的 luarocks.bat
脚本应该已经用安装程序安装它们的目录进行了开箱即用的配置。启动时使用了哪些标志install.bat
?)
我从这里安装了 luarocks-2.2.1-win32:
https://keplerproject.github.io/luarocks/releases/
而且安装很简单。有一个 .bat 文件可以完成这一切。但不幸的是,下载的岩石无法被LUA识别。我通过发出
检查了我的 LUA 安装luarocks config
得到这个:
C:\Program Files (x86)\Lua.1\lua: C:\Program Files (x86)\Lua.1\luarocks.lua:3: module 'luarocks.command_line' not found:
no field package.preload['luarocks.command_line']
no file 'C:\Program Files (x86)\LuaRocks.2\lua\luarocks\'
no file 'C:\Program Files (x86)\LuaRocks.2\lua\luarocks\init.lua'
no file 'C:\Program Files (x86)\LuaRocks\systree\share'
no file 'C:\Program Files (x86)\LuaRocks\systree\share\lua.1\luarocks\command_line.lua'
no file 'C:\Program Files (x86)\LuaRocks\systree\share\lua.1\luarocks\command_line\init.lua'
no file 'C:\Program Files (x86)\LuaRocks\systree\share\lua.1'
no file 'C:\Program Files (x86)\LuaRocks\systree\lib\lua.1\luarocks\command_line.dll'
no file 'C:\Users\Stefan\AppData\Roaming\LuaRocks\share\lua.1\luarocks\command_line.lua'
no file 'C:\Users\Stefan\AppData\Roaming\LuaRocks\lib\lua.1\luarocks\command_line.dll'
no file '.\luarocks\command_line.dll'
no file '.\luarocks\command_line51.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks\command_line.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks\command_line51.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks\command_line.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks\command_line51.dll'
no file 'C:\Program Files (x86)\Lua.1\loadall.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\loadall.dll'
no file '.\luarocks.dll'
no file '.\luarocks51.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks.dll'
no file 'C:\Program Files (x86)\Lua.1\luarocks51.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\luarocks51.dll'
no file 'C:\Program Files (x86)\Lua.1\loadall.dll'
no file 'C:\Program Files (x86)\Lua.1\clibs\loadall.dll'
stack traceback:
[C]: in function 'require'
C:\Program Files (x86)\Lua.1\luarocks.lua:3: in main chunk
[C]: ?
有人有将 LUArocks 安装到 windows 的经验吗?
这一行
no file 'C:\Program Files (x86)\LuaRocks.2\lua\luarocks\'
表示您的 LUA_PATH
文件不正确,因为它生成的文件名没有您要查找的模块的名称(通常看起来像 C:\Program Files (x86)\LuaRocks.2\lua\luarocks\command_line.lua
.
在 LUA_PATH
和 LUA_CPATH
变量中,字符 ?
扩展为模块名称,例如,如果 LUA_PATH
是 c:\mymodules\?.lua
,尝试要求模块 foo.bar
将打开 c:\mymodules\foo\bar.lua
.
添加到 LUA_PATH
的路径时,通常会为每个目录添加两个变体,例如假设的 c:\mymodules
:c:\mymodules\?.lua;c:\mymodules\?\init.lua
。当您对 Lua 模块所在的实际目录执行此操作时,Lua 会找到它们。
(不过,由 LuaRocks 安装的 luarocks.bat
脚本应该已经用安装程序安装它们的目录进行了开箱即用的配置。启动时使用了哪些标志install.bat
?)