安装 luasocket/lfs 时遇到问题使用 luarocks

我安装了 luarocks,现在我正在尝试使用它来安装 luasocket。

我的命令是

luarocks install luasocket-2.0.2-3.win32-x86.rock

我得到的响应是

C:\Program Files (x86)\LuaRocks\lua\luarocks\command_line.lua:186: bad argument #1 to 'require' (string expected, got table)

command_line.lua中的代码行给出了麻烦

if commands[command] then
    local cmd = require(commands[command])

将跟踪写入代码后发现 commands[command]确实是一个长度为零的表。

这种基本的运行时错误远远超出了Lua初学者的修复范围。有什么建议吗?

Edit

事实证明,这不仅是 luasocket 的问题。我在

``` luarocks install luafilesystem

```中遇到了同样的问题。

点赞
用户2084384
用户2084384

原来这是由于我安装了一个我不知道的旧的 LuaRocks 2.0.10 版本引起的。它是由于安装 LuaDist-Batteries 失败所引入的。

解决方案在这里: https://github.com/luarocks/luarocks/issues/714

2017-07-05 08:28:51