我正在使用 better_errors
WSL 环境中的 gem。
当我使用 Mac 时,我可以通过单击错误页面的文件路径来打开一个文件,如下所示。
我在 config/environments/development.rb
中有这条线.
BetterErrors.editor='x-mine://open?file=%{file}&line=%{line}' if defined?(BetterErrors)
链接 URL 似乎已正确创建。x-mine://open?file=%2Fhome%2Fironsand%2Fdev%2Fmyapp%2Fapp%2Fcontrollers%2Fcompanies_controller.rb&line=12`
如何打开以 x-mine:
开头的 URL在 Windows 中?
最佳答案
从 Microsoft 文档本身来看,您必须破解系统注册表。
你需要像下面这样设置它:
HKEY_CLASSES_ROOT
x-mine
(Default) = "URL:RubyMine Protocol"
URL Protocol = ""
shell
open
command
(Default) = "C:\Program Files\IntelliJ\mine.exe" "%1"
(您可能需要更改您的路径以指向您安装 RubyMine 的实际路径)。见 https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85)?redirectedfrom=MSDN更多细节。
关于ruby-on-rails - 如何在 WSL 环境中使用 Better_errors 启动编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69096220/