Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
通过设置
LUA_PATH
环境变量,在 Lua 安装之间切换应该相当简单。引用 Lua 文档中的此页面:It should be fairly simple to switch between Lua installs by setting the
LUA_PATH
environment variable. Quoting this page from the Lua documentation:[已存档] 你尝试过 LuaDist 吗?
它通过使用所谓的“部署”来解决这个问题——它是一个单独的目录,其中安装了所有依赖项和库(甚至 Lua 解释器),独立于整个系统。
[archived] Have you tried LuaDist?
It solves exactly this issue by using so called 'deployments' - it is a single directory in which all dependencies and libraries (and even Lua interpreter) are installed, independent of the whole system.
看起来 vert 就是您正在寻找的内容。
就像 Python 中的 virtualenvwrapper 一样,它允许您定义一个独立的 Lua 环境。
此外,它可以从 luarocks 获得。
It looks like vert is what you are looking for.
Like
virtualenvwrapper
in Python, it allows you to define a self-contained Lua environment.Furthermore, it is available from luarocks.
在Lua 5.1中有一个环境表,你可以将其放入全局变量中,然后使用该表加载字符串或文件作为_G,封装该文件。
In Lua 5.1 there is the environment table, which you can put in global variables and then load strings or files with that table as _G, encapsulating that file.