【问题标题】:How to launch a editor with better_errors in WSL environments如何在 WSL 环境中使用 better_errors 启动编辑器
【发布时间】:2021-09-08 02:11:18
【问题描述】:

我在 WSL 环境中使用 better_errors 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`

如何在 Windows 中打开以x-mine: 开头的 URL?

【问题讨论】:

    标签: ruby-on-rails ruby windows rubymine


    【解决方案1】:

    根据 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

    【讨论】:

    • 感谢您的回答 x-mine 被识别为 URL 协议,我可以通过“c:\Program Files\JetBrains\RubyMine 2021.2\bin\rubymine64.exe”打开 URL,但似乎我还需要将/ 替换为``。我会检查是否可以配置文件路径。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    • 2020-07-03
    • 2021-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多