【问题标题】:How can I install lua modules/libraries via Lua Rocks?如何通过 Lua Rocks 安装 lua 模块/库?
【发布时间】:2020-02-12 05:57:28
【问题描述】:

我安装了 JSON 库并将其与 require 一起使用,现在我想安装一个日期/时间库,但它说我必须通过 Lua Rocks 安装它。我搜索了这个,但毕竟没有结果

日期/时间库链接:https://github.com/daurnimator/luatz

我下载了luarocks.zip并点击了install.bat,在我的终端中打开它,现在我遇到了一个新的挑战:

========================
== Checking system... ==
========================

Admin privileges available for installing

Looking for Lua interpreter

    checking C:\Users\Administrator\Downloads\Compressed\Cmder\vendor\conemu-maximus5\ConEmu\Scripts

    checking C:\Users\Administrator\Downloads\Compressed\Cmder\vendor\conemu-maximus5

    checking C:\Users\Administrator\Downloads\Compressed\Cmder\vendor\conemu-maximus5\ConEmu

    checking C:\Program Files\Common Files\Oracle\Java\javapath

    checking C:\ProgramData\Oracle\Java\javapath

    checking C:\Windows\system32

    checking C:\Windows

    checking C:\Windows\System32\Wbem

    checking C:\Windows\System32\WindowsPowerShell\v1.0

    checking C:\Program Files\GtkSharp\2.12

    checking C:\Users\Administrator\Downloads\Compressed\Lua53

       Found lua53.exe, testing it...

       Error: interpreter does not work

    checking c:\lua5.1.2

    checking c:\lua

    checking c:\kepler\1.1

Could not find Lua. See /? for options for specifying the location of Lua, or installing a bundled copy of Lua 5.1.

Failed installing LuaRocks. Run with /? for help.

【问题讨论】:

    标签: lua installation


    【解决方案1】:

    首先,安装包管理器 Luarocks。 说明:

    Windows

    MacOS

    Linux or other Unix

    接下来,打开您的终端/命令提示符。 输入luarocks install luatz

    您应该能够立即使用 local luatz = require "luatz" 要求 luatz

    【讨论】:

    • 我试图下载 lua Rocks,但是当我点击 install.bat 时,它显示一个错误:
    • @BlaztOne 你能发布错误代码吗?如果没有看到错误,我真的无能为力。但我的建议是尝试从命令行运行 install.bat 而不是单击它。我不知道这是否会有所帮助,但您可以在发布错误代码之前尝试一下。
    • 我在“:”后面贴出了错误代码。 “:”之后的所有内容都是错误代码
    • 检查我的问题,我编辑了它。我添加了错误代码
    • 您的 \downloads\compressed\lua53 文件夹是否在 .exe 周围有其他可能看起来像 lua53.dll 的文件,或者您是否在其他地方安装了完整的 Lua?我快速浏览了一些其他人的错误代码,看起来应该有一个“找到的解释器,正在寻找链接库”块。确认 Lua 安装完成后,我建议在 install.bat 所在的目录中运行命令 install.bat /LUA C:\Users\Administrator\Downloads\Compressed\Lua53。 (给stackoverflow.com/questions/41329860/luarocks-installation的帽子提示)
    猜你喜欢
    • 2016-05-02
    • 2020-03-10
    • 2019-11-05
    • 2018-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    • 2018-03-06
    相关资源
    最近更新 更多