Search code examples
ruby-on-railsrubyminepopen3xray-rails

How to configure rubymine for use with open3?


Issue

I am using xray-rails gem in a rails app and want it to open rubymine to the correct file when I click it in the browser. It was unclear how to configure this. xray-rails gem uses open3 to open the file in the editor.


Solution

  • Solution

    Prerequisite: Follow the instructions for setting up rubymine to be callable from the commandline found in Running RubyMine as a Diff or Merge Command Line Tool

    NOTE: This is also a handy use of rubymine, allowing it to perform diffs between files. Nice bonus for researching a solution to my problem.

    Create ~/.xrayconfig with content...

    :editor: mine
    

    NOTE: mine is the name of the script created in the prerequisite steps. If you named your script something different, use that name in place of mine.

    Now when you start xray-rails in your browser and click, the corresponding file will open in rubymine.