RubyMine无法从git存储库中识别gem

时间:2013-12-26 09:47:55

标签: git autocomplete rubygems rubymine gemfile

我们有一个带有自定义gem的git存储库。 要安装它,Gemfile有一行:

gem 'my-gem', :git => 'git@192.168.1.100:my-gem.git'

安装gem后,它不会显示在RubyMine的外部库中。

如何让gem显示在外部库中,并且gem中的代码是自动完成的?

2 个答案:

答案 0 :(得分:1)

我们也得到了这个错误,所以它可能是RubyMine中的一个错误。解决方法是检查gem repo并告诉bundler使用它。请注意,将不再使用远程存储库。

bundle config local.my-gem /path/to/my-gem/
bundle install

然后将my-gem添加到rubymine中的现有窗口explained here。这使我们的前向导航和代码完成工作。

答案 1 :(得分:1)

在RubyMine 2017中修复了

A bug relating to detecting gems installed from git with bundler。该错误引用了bundle方法git_source,但该错误的重复没有引用该方法,所以它似乎是识别使用bundler从git安装的gems的一般问题。因此升级到2017.1或更高版本,以便比以前的版本更频繁地识别此类宝石。

在最新版本2017.2 EAP 5中,仍有a bug in recognizing gems installed from git by bundler on the command line。如果您已完成此操作并且宝石没有出现在外部库等中,您可以执行以下任何操作:

    来自RubyMine内部的
  • bundle install(工具→Bundler→安装)
  • 退出并重新启动RubyMine
  • 简单地编辑Gemfile,例如通过编辑空格,以便RubyMine注意到某些内容已发生变化
相关问题