In a ruby project. when point is at a ruby symbol, for example UserCart::PromotionService.new(blah blah how can I jump to the definition of that class/module.

  • Normally, this functionality is bound to M-.. I have no idea if the mode you're using for editing ruby source code has that functionality and whether it's good enough to look for class definitions, but you can always try it. – DoMiNeLa10 Jul 18 '18 at 15:40
  • I suspect that both ctags.sourceforge.net and github.com/universal-ctags/ctags have ruby parsers. Therefore you could index your project with one of these tools, then follow DoMiNeLa10's answer. – InHarmsWay Jul 18 '18 at 17:33

Found the answer in a youtube


Specifically as a prelude user, what I did was

kill emacs daemon

;; add to personal.el
(prelude-require-packages '(

emacs --daemon
emacs ~/repo/app/controllers/foo_controller.rb
M-x robe-start
M-x robe-mode
place cursor at contant/sumbol
M-x robe-jump-to-module

And sure enough, I was "teleported" to the module definition in the rails application.

Update: As pointed in a previous comment, you can press M-. and save yourself typing robe-jump-to-module

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.