【发布时间】:2018-04-10 18:47:27
【问题描述】:
我正在开发 Debian 稳定版 Linux。我通过命令安装了 luafilesystem 模块:
luarocks --local install luafilesystem
但是,在lua源文件中使用以下任何一种都找不到:
require ("lfs")
require ("luafilesystem")
(虽然这些文件在 ZeroBraneStudio IDE 中运行时可以正常运行)。
根据网上的建议,我还运行了以下命令:
luarocks --local install luarocks
但这无济于事。我检查了 luarocks-admin 命令,显示:
CONFIGURATION
Lua version: 5.1
Configuration files:
System: /etc/luarocks/config.lua (ok)
User : /home/abcd/.luarocks/config-5.1.lua (not found)
Rocks trees in use:
/home/abcd/.luarocks
/usr/local
目前,我只安装了这两个模块:
$ luarocks list
Installed rocks:
----------------
luafilesystem
1.7.0-2 (installed) - /home/abcd/.luarocks/lib/luarocks/rocks
luarocks
2.4.3-1 (installed) - /home/abcd/.luarocks/lib/luarocks/rocks
我应该为此复制 /etc/luarocks/config.lua 到 /home/abcd/.luarocks 吗?感谢您的帮助。
【问题讨论】:
-
你先
require "luarocks.loader"吗? -
我使用
sudo luarocks install luafilesystem安装了模块(没有 --local 选项)并且它可以工作。那么本地安装的模块需要luarocks.loader吗?