Creating TAGS for Ruby and Emacs

1

0

I ran the following from my top level Ruby on Rails directory.

find . -name "*.rb" | etags -

Then within Emacs I visited that tag file. This works reasonably well to find some of the methods and most of the files, however it is having trouble finding some of the extra methods/classes that I use in my helpers directory.

For example, I have a file in my helpers directory called my_foo_helper.rb If I search my tags for that file, it finds it. However, if I try to find a tag for one of the methods within that module it doesn't find it at all.

If I use Aptana or something like that it seems to be able to locate those methods.

How can I resolve this problem?

hortitude

Posted 2009-10-02T16:44:43.820

Reputation: 171

Answers

2

Have you checked rtags?

rtags is a Ruby replacement for ctags - allowing for name navigation in source code using vim, emacs and others.

Also look at this Emacs ruby-mode posting.

nik

Posted 2009-10-02T16:44:43.820

Reputation: 50 788

0

This should work fine with etags that comes with Emacs 25.1 (to be released later this year). The pre-release builds are available.

If you're still having problems, please file bugs with M-x report-emacs-bug and include specific (but maybe fictionalized) code examples.

dgutov

Posted 2009-10-02T16:44:43.820

Reputation: 123

0

I use a number of ruby/rails specific plugins for vim.

Being the behemoth that emacs is, I presume there would be similar. The plugins I use actually process the code (Rather than grepping it) giving it a better awareness of such a dynamic language, which leaves my editor better able to work out what I'm looking for.

richo

Posted 2009-10-02T16:44:43.820

Reputation: 359

0

etags still doesn't deal nicely with ruby. On OSX though there is a simple solution, see: http://www.murphybytes.com/2012/06/28/etags-for-ruby-in-emacs-on-a-mac/

Joel Jackson

Posted 2009-10-02T16:44:43.820

Reputation: 101

1Welcome to Super User. Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. – daxlerod – 2013-06-27T17:44:27.490