Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting auto-complete to work with Ruby Gems in Sublime Text 2, with SublimeCodeIntel and RVM

I have been trying (unsuccessfully) all morning to get the SublimeCodeIntel (forked from Komodo's CodeIntel feature) plugin for Sublime Text 2 to auto-complete stuff from installed Ruby Gems, in conjunction with (or without, for that matter) RVM on my Mac. It doesn't seem to have any problems with built in stuff, or even rake for that matter, but it can't seem to pick up any Gems.

With RVM, I installed Ruby 1.9.3, then with a global gemset, installed Mustache:

$ rvm install 1.9.3
$ rvm --default use 1.9.3
$ gem install mustache
$ irb
>> require 'mustache'
=> true

All is good so far. Now I start Sublime, with SublimeCodeIntel installed, and make a file. Typing require ' then CMD+J yields a pop-up, as expected, with available modules / directories. However, mustache isn't one of them. (things like abbrev, base64, and rake are, though)

I check the CodeIntel config, find that it is still using the system ruby, so I switch it:

{
  "Ruby": {
    "ruby": "~/.rvm/bin/default_ruby"
  }
}

Still no dice. I switched back to system ruby, installed mustache there, and tried again, with no luck.

After switching back, I realized that maybe CodeIntel just can't find the file, even though ruby can, so I explicitly added the gem bin directory to the config file:

"rubyExtraPaths":["~/.rvm/gems/ruby-1.9.3-p0/bin"]

And it STILL didn't work.

Now, I'm still a beginner at working with Ruby, Gems, and RVM, so maybe I'm missing something painfully obvious, but I did look through all the documentation I could find on any of it, and didn't find anything.

Does anybody have any idea what may be wrong here?

like image 921
Austin Hyde Avatar asked Nov 26 '11 19:11

Austin Hyde


People also ask

How do I enable autocomplete in Sublime Text?

By default, Sublime Text will automatically show the completions popup when a user is editing source code or markup, but not within prose in comments, strings or markups. Pressing the Esc key will hide the completions popup. To manually show the completions popup, press Ctrl+Space.

Does Sublime Text support Ruby?

If you want to kick it up a notch, the Sublime CodeIntel plugin is probably the closest thing to intelli-sense that we have for Sublime Text w/ Ruby, supporting: Jump to Symbol Definition - Jump to the file and line of the definition of a symbol.


1 Answers

It's an old CodeIntel bug: http://bugs.activestate.com/show_bug.cgi?id=72335

Seems that nobody is going to fix it.

like image 120
Arenielle Avatar answered Oct 07 '22 21:10

Arenielle