Windows 7 64位。
运行bog-standard windows命令shell(在我的系统上,它位于此处:c:\windows\system32\cmd.exe
)我可以使用简单的lua脚本,下面是输出:
D:\user\workspace\_lua>lua yamltest.lua
Lua Version: 5.1
doc_path = d:\user
Found file: .
Found file: ..
Found file: downloads
Found file: install
Found file: My Network Area.lnk
Found file: mybin
Found file: personal
Found file: sandbox
Found file: starter_stuff
Found file: tasks.csv
Found file: workspace
loading yaml...
yaml loaded: mytest.yaml
end
................
但是,当我使用不同的命令shell运行它时,例如consoleZ(控制台2)或ConEmu,当我运行完全相同的命令时,我会收到错误。像这样:
D:\user\workspace\_lua>lua yamltest.lua
Lua Version: 5.1
doc_path = d:\user
Found file: .
Found file: ..
Found file: downloads
Found file: install
Found file: My Network Area.lnk
Found file: mybin
Found file: personal
Found file: sandbox
Found file: starter_stuff
Found file: tasks.csv
Found file: workspace
d:\user\install\lua\luarocks\lua.exe: error loading module 'yaml.core' from file 'D:\user\install\lua\luarocks\systree\lib\lua\5
Invalid access to memory location.
stack traceback:
[C]: ?
[C]: in function 'require'
...all\lua\luarocks\systree\share\lua\5.1\yaml\init.lua:26: in main chunk
[C]: in function 'require'
yamltest.lua:13: in main chunk
[C]: ?
这似乎是一个运行时问题 - 当我通过IDE运行命令时,我得到了相同的输出,但也有一个这样的窗口:
我已经尝试了一大堆东西来找出差异可能是什么......
C:\windows\system32\cmd.exe
,仍然失败。这里有什么问题? - 我真的看不出可能有什么区别? - 但这两种方法之间显然存在一些差异......