【问题标题】:RubyMine doesn't recognize gem from git repositoryRubyMine 无法识别来自 git 存储库的 gem
【发布时间】:2013-12-26 09:47:55
【问题描述】:

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

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

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

如何使 gem 显示在外部库中并自动完成 gem 中的代码?

【问题讨论】:

    标签: git autocomplete rubygems rubymine gemfile


    【解决方案1】:

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

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

    然后通过将 my-gem 添加到您现有的 ruby​​mine 窗口中作为 explained here 打开它。这为我们提供了向前导航和代码完成的工作。

    【讨论】:

      【解决方案2】:

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

      在可用的最新版本 2017.2 EAP 5 中,仍有a bug in recognizing gems installed from git by bundler on the command line。如果您已经这样做了,并且 gem 没有出现在外部库等中,您可以执行以下任何操作:

      • bundle install 来自 RubyMine 内部(工具 → 捆绑器 → 安装)
      • 退出并重新启动 RubyMine
      • 简单地编辑 Gemfile,例如编辑空格,以便 RubyMine 注意到发生了变化

      【讨论】:

      • 在 RubyMine 2017.2.4 中明确修复
      • @orkenstein 我正在使用 RubyMine 2017.2.4,但它仍然坏了。
      猜你喜欢
      • 2017-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-03
      • 2016-06-20
      • 2017-05-08
      相关资源
      最近更新 更多