add method of resolve VSCode rust-analyzer dyld not load problem to troubleshoot
when using VSCode rust-analyzer plugin(which is recommended for using vscode), it would report "dyld not loaded".because it will NOT load DYLD_FALLBACK_LIBRARY_PATH environment variable.
you should open setting->rust-analyzer->server->env variables or open setting.json file of vscode and put this:
"rust-analyzer.server.extraEnv": {
"DYLD_FALLBACK_LIBRARY_PATH": "<your fallback path>",
"LDFLAGS": "-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib",
"LD_LIBRARY_PATH": "${LD_LIBRARY_PATH}:/usr/local/lib"
}
or you can just use rust-cover developed by jetBrains
got the same issue in zed editor, fixed with configurations as follows in .zed/settings.json { "lsp": { "rust-analyzer.server.extraEnv": { "DYLD_FALLBACK_LIBRARY_PATH": "/Library/Developer/CommandLineTools/usr/lib", "LDFLAGS": "-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib", "LD_LIBRARY_PATH": "/usr/local/lib" } } }
Thank you for the configs! I'm going to add the link to this issue in the troubleshooting section for further reference.