我下载了 Lua 和 Ravi 5.3 Debugger 插件并更改了 lanuch.json。我只是将 torch-activate 中的所有路径添加到其中。
{
"version": "0.2.0",
"configurations": [
{
"name": "Ravi Debugger",
"type": "lua",
"request": "launch",
"program": "${workspaceRoot}/main.lua",
"stopOnEntry": true,
"cwd": "${workspaceRoot}",
"LUA_PATH": "$/home/yan/.luarocks/share/lua/5.1/?.lua;/home/yan/.luarocks/share/lua/5.1/?/init.lua;/home/yan/torch/install/share/lua/5.1/?.lua;/home/yan/torch/install/share/lua/5.1/?/init.lua;./?.lua;/home/yan/torch/install/share/luajit-2.1.0-beta1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua",
"LUA_CPATH": "/home/yan/torch/install/lib/?.so;/home/yan/.luarocks/lib/lua/5.1/?.so;/home/yan/torch/install/lib/lua/5.1/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so"
}
]
}
然后错误发生在消息中:
Debugger initialized
Program terminated with error: error loading module 'libpaths' from file '/home/yan/torch/install/lib/lua/5.1/libpaths.so':
/home/yan/torch/install/lib/lua/5.1/libpaths.so: undefined symbol: lua_replace
我还没有谷歌正确的解决方案。提前致谢!