我有以下 luarocks:
package = "project-name"
version = "1.0-1"
source = {
url = "..."
}
description = {
summary = "etc"
detailed = [[]],
homepage = ""
}
dependencies = {
"lua >= 5.1, < 5.2",
"busted >= 2.0.rc12",
"lua-requests >= 1.1",
"json-lua >= 0.1",
"lua-resty-dogstatsd >= 1.0.1"
}
build = {
type = "builtin",
modules = {
["project-name"] = "project/init.lua"
}
}
Run Code Online (Sandbox Code Playgroud)
如何安装依赖项?做luarocks install
说我缺少论据。不知道在这里做什么。
要手动安装单个依赖项,您可以运行
luarocks install <dep-name>
Run Code Online (Sandbox Code Playgroud)
您可以附加可选版本,例如
luarocks install lua-resty-jwt 0.1.11-0
Run Code Online (Sandbox Code Playgroud)
要安装 Rockspec 文件中列出的所有依赖项,
luarocks install --only-deps <rockspec_file>
Run Code Online (Sandbox Code Playgroud)
来自手册luarocks install
:
--only-deps 仅安装 rock 的依赖项。
或者,您可以简单地运行
luarocks make
Run Code Online (Sandbox Code Playgroud)
它还将为您安装缺少的依赖项。但是,请注意,这可能不是您想要的,具体取决于您的需求:
该命令作为调试 rockspecs 的工具很有用。要安装 Rocks,您通常需要使用“安装”和“构建”命令。有关详细信息,请参阅有关这些内容的帮助。
注意:如果您只想安装 rockspec 的依赖项,请
luarocks install
与该标志一起使用(请参阅 参考资料)。--only-deps
luarocks help install
小智 -6
好的,出了什么问题
luarocks install busted
luarocks install lua-requests
luarocks install json-lua
luarocks install lua-resty-dogstatsd
Run Code Online (Sandbox Code Playgroud)