Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I open a gem for editing in RubyMine?

Does anyone know how I can use RubyMine to open a gem for editing?

If this is not possible, then how do I set RubyMine as my default editor to open the gem?

like image 290
chugh97 Avatar asked Sep 05 '25 03:09

chugh97


2 Answers

On Mac, in your ~/.bash_profile:

export EDITOR=/Applications/RubyMine.app/Contents/MacOS/rubymine

then bundle open the-gem. Adjust to taste for other OSes.

You can also use RubyMine's "Tools -> Create Command line Launcher" to create a launcher script and set EDITOR to that.

Alternatively, if the gem you want to browse is part of a RubyMine project, you don't need to bother with bundle open: just open External Libraries at the very bottom of the Project tab, find the gem, and browse and edit just as you would your own code.

RubyMine will warn you before allowing you to edit a file in a gem, but will allow you to do so if you insist.

like image 61
Dave Schweisguth Avatar answered Sep 07 '25 22:09

Dave Schweisguth


Very often you can just open gem in a project's tab.

enter image description here

like image 38
Евгений Масленков Avatar answered Sep 07 '25 22:09

Евгений Масленков