【问题标题】:How to install Lua modules (json, uuid, etc...) for wrk2如何为 wrk2 安装 Lua 模块(json、uuid 等)
【发布时间】:2020-03-10 19:15:33
【问题描述】:

我已经在 Mac OS 上通过 homebrew 安装了 wrk2。 (https://github.com/giltene/wrk2/wiki/Installing-wrk2-on-Mac)

我能够运行 wrk2 命令并且简单的负载测试工作正常。但是,我想为需要 json 和 uuid 库的请求正文做更复杂的事情。

在我的终端中,我似乎没有安装 lua

➜ lua
zsh: command not found: lua
➜ luarocks
zsh: command not found: luarocks

当我导入 uuid 或 json 模块时,我在运行 wrk 时看到此错误

test.lua: test.lua:1: module 'json' not found:
    no field package.preload['json']
    no file './json.lua'
    no file '/usr/local/share/luajit-2.0.3/json.lua'

为 wrk2 获取这些模块的最佳方式是什么?

【问题讨论】:

    标签: lua wrk


    【解决方案1】:

    只需使用brew 安装:

    brew install lua
    brew install luarocks
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-04
      • 2018-03-06
      • 2021-10-15
      • 2013-04-18
      • 2017-05-26
      • 2019-11-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多