使用 SublimeCodeIntel 和 RVM 在 Sublime Text 2 中使用 Ruby Gems 自动完成
我整个早上都在尝试(没有成功)获取 SublimeCodeIntel (从 Komodo 的 CodeIntel 功能分叉)插件 Sublime Text 2 与我的 Mac 上的 RVM 结合(或不结合),自动完成已安装的 Ruby Gems 中的内容。它的内置东西似乎没有任何问题,甚至耙子也没有任何问题,但它似乎无法拾取任何宝石。
使用 RVM,我安装了 Ruby 1.9.3,然后使用全局 gemset,安装了 Mustache:
$ rvm install 1.9.3
$ rvm --default use 1.9.3
$ gem install mustache
$ irb
>> require 'mustache'
=> true
到目前为止一切都很好。现在我启动 Sublime,安装了 SublimeCodeIntel,并创建一个文件。输入 require '
然后 CMD+J 会按预期生成一个弹出窗口,其中包含可用的模块/目录。然而,小胡子
并不是其中之一。 (不过,abbrev
、base64
和 rake
等)
我检查了 CodeIntel 配置,发现它仍在使用系统 ruby,所以我切换它:
{
"Ruby": {
"ruby": "~/.rvm/bin/default_ruby"
}
}
仍然没有骰子。我切换回系统 ruby,在那里安装了 Mustache,然后再次尝试,但没有成功。
切换回来后,我意识到也许 CodeIntel 找不到该文件,尽管 ruby 可以,所以我明确地将 gem bin 目录添加到配置文件中:
"rubyExtraPaths":["~/.rvm/gems/ruby-1.9.3-p0/bin"]
但它仍然不起作用。
现在,我仍然是使用 Ruby、Gems 和 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个旧的 CodeIntel 错误:http://bugs.activestate.com/show_bug.cgi?id =72335
似乎没有人会修复它。
It's an old CodeIntel bug: http://bugs.activestate.com/show_bug.cgi?id=72335
Seems that nobody is going to fix it.