Ruby on rails VScode中没有这样的文件或目录

Ruby on rails VScode中没有这样的文件或目录,ruby-on-rails,ruby,visual-studio-code,rubygems,vscode-settings,Ruby On Rails,Ruby,Visual Studio Code,Rubygems,Vscode Settings,有人对此错误有解决方案吗?' dan@LAPTOP-U61VD2F3:/mnt/c/Users/danyl/Desktop/New folder$ ruby "c:\Users\danyl\Desktop\New folder\Lesson.rb" Traceback (most recent call last): ruby: No such file or directory -- c:\\Users\\danyl\\Desktop\\New folder\\L

有人对此错误有解决方案吗?'

dan@LAPTOP-U61VD2F3:/mnt/c/Users/danyl/Desktop/New folder$ ruby "c:\Users\danyl\Desktop\New folder\Lesson.rb"     
Traceback (most recent call last):
ruby: No such file or directory -- c:\\Users\\danyl\\Desktop\\New folder\\Lesson.rb (LoadError)
dan@LAPTOP-U61VD2F3:/mnt/c/Users/danyl/Desktop/New folder$
这种情况下的解决方案:

转到Vscode中的settings.json文件,并将此行添加到设置中:

“代码运行程序.终端根”:“/mnt/”

或者,您可以打开设置并查找代码运行程序:终端根,然后键入以下内容:

/mnt/


注意:对于Windows系统,在使用自定义shell作为终端(如Bash或Cgywin)时,将命令中的Windows样式驱动器号替换为Unix样式的根。示例:将此设置为“/mnt/”将用“/mnt/C/path”替换“C:\path”

尝试重命名没有空格的“New folder”,并确保名为lessue.rb的文件位于“New folder”中Giuseppe感谢您的回答,但它不起作用。请不要说“它不起作用”。请通过以下方式解释您自己“当我做x时,我得到了y。我之前得到了z,希望得到n。”像“它不起作用”这样的短语是不能提供诊断有用信息的填充词。Anotherm也感谢你的回答,但没有太多的解释,我放弃了建议,诊断分析的结果是相同的“它不起作用”“再次感谢您明确的回答,如果您有错误,请随时添加解决方案,谢谢您的时间!