如何更改已安装的Lua版本(Windows 10)

时间:2016-06-27 23:14:41

标签: lua

试图掌握LuaDist。

按照https://github.com/LuaDist/Repository/wiki/LuaDist%3A-Installation上的说明操作,并通过使用以下方法构建新部署来测试安装:

cd _install\bin
luadist C:\my_lua install lua luasocket md5
cd C:\my_lua\bin
lua -e "require 'md5'"

但是我收到以下错误消息:

Finding out available versions of lua...
Getting lua-5.3.2 (source)...
Finding out available versions of luasocket...
Getting luasocket-3.0-rc1 (source)...
 - trying another candidate due to: Error getting dependency of 'luasocket-3.0-rc1': Package 'lua >=5.1,<5.3' needed, but selected at version '5.3.2'.
Getting luasocket-2.1-dev (source)...
 - trying another candidate due to: Error getting dependency of 'luasocket-2.1-dev': Package 'lua >=5.1,<5.3' needed, but selected at version '5.3.2'.
Getting luasocket-2.0.2 (source)...
 - trying another candidate due to: Error getting dependency of 'luasocket-2.0.2': Package 'lua ~>5.1' needed, but selected at version '5.3.2'.
Getting luasocket-scm (source)...
Cannot install package 'luasocket': Error getting dependency of 'luasocket-3.0-rc1': Package 'lua >=5.1,<5.3' needed, but selected at version '5.3.2'.

所以我用Google搜索并找到了这个页面:https://github.com/LuaDist/Repository/issues/221

其中说lua 5.3.2尚不支持,解决方法是使用lua 5.2

所以,我极其乐观地盲目地执行了他建议的命令:

luadist.exe c:\lua52 install lua-5.2 luasec

它给了我以下信息:

C:\TDM-GCC-64\_bootstrap\_install\bin>luadist.exe c:\lua52 install lua-5.2
Finding out available versions of lua...
Getting lua-5.2 (source)...
Building lua-5.2...
Installation successful.

但是当我回到运行原始命令来测试部署时(如上所述),我得到了与上面相同的依赖性错误。

如何让我的LuaDist从5.3.2切换到5.2?

编辑:嗯,刚刚意识到我实际上错过了luasec的命令。所以不知道我现在做了什么......

为了正确运行他的命令值得:

C:\TDM-GCC-64\_bootstrap\_install\bin>luadist.exe c:\lua52 install lua-5.2 luasec
Finding out available versions of luasec...
Getting luasec-0.4 (source)...
Finding out available versions of luasocket...
Getting luasocket-2.0.2 (source)...
 - trying another candidate due to: Error getting dependency of 'luasec-0.4': Error getting dependency of 'luasocket-2.0.2': Package 'lua ~>5.1' needed, but installed at version '5.2'.
Getting luasec-scm (source)...
Finding out available versions of luasocket...
Getting luasocket-2.0.2 (source)...
 - trying another candidate due to: Error getting dependency of 'luasocket-2.0.2': Package 'lua ~>5.1' needed, but installed at version '5.2'.
Getting luasocket-2.0.2 (source)...
Cannot install package 'luasec': Error getting dependency of 'luasec-0.4': Error getting dependency of 'luasocket-2.0.2': Package 'lua ~>5.1' needed, but installed at version '5.2'.

1 个答案:

答案 0 :(得分:1)

Luadist基于Lua 5.1(某些模块可以使用5.2或5.3)。尝试使用lua 5.1

luadist.exe c:\ lua51安装lua-5.1.5 luasec