How to view the source code for a gem in Rails3 using RVM (linux & gedit)

I run rails3 on Ubuntu and use gedit for coding. I am using RVM. To look at the source code of the gem, I tried: bundle open jquery-rails

This does not work as I did not configure the editor. After installing gedit as an editor, it still does not work, because gedit cannot transfer directories. I think it only works with files. Too bad: (.

nathan.f77 the answer to this question ( Lookup Gem code or plugin packaged in a Rails3 application ) seems promising, but I could not follow its instructions. They did not have enough details for me.

What is an easy way to view the source files for gems that I use in my rails3 application?

+4
source share
3 answers

Cuba's answer Libra got me halfway. Another piece of the puzzle that I was able to get from Ask Ubuntu .

Below are the steps for viewing gem code in gedit using Ubuntu.

a. From the command line:

 gnome-open $(bundle show [gem-name]) 

b. This will open a catalog of gems in nautilus. From there, simply double-click the file you want to see, and it will open in gedit.

+2
source

bundle show jquery-rails should tell you where the gemstone source lives on your file system. Then open the file you want.

+12
source

Assuming you have a default editor installed in your terminal, on MacOS you can do something like this example (atom is my editor, but it should work with sublime or text, vim, etc.):

 atom $(bundle show name_of_gem) 
0
source

All Articles