LoginSignup
16
12

More than 5 years have passed since last update.

path指定でbundle installしたGemのメソッドがRubyMineでコード補完されない問題の解決方法

Last updated at Posted at 2015-09-02

環境
- RubyMine7.1.4

問題点

Railsアプリケーションを作る時は

bundle install --path vndor/bundle

で、任意のパスにGemをインストールする事がよくあると思います(というかほとんどそうだと思います
このプロジェクトをRubyMineを開くと、before_actionbelongs_toのメソッドがコード補完されない。(IDE使っているのにコード補完されないなんて!
before_actionにいたっては、「Cannot find 'before_action'」と警告がでる。

Kobito.LsZqkF.png

なぜ起こるのか

RubyMineに.bundle/configBUNDLE_PATHを見てくれないバグがあるようです
Gems in vendor/bundle are not listed as external dependencies : RUBY-16428

解決方法

https://gist.github.com/robd/ebd2570cc8c50bcda072 のスクリプトを実行すると、使用しているGemの一覧をRubyMineの設定ファイルに反映してくれる。実行後はRubyMineを再起動する。
※新しくGemを追加したらその都度実行する必要がある

その他

このバグは次期バージョンで修正されいるようなので、期待して待ちましょう:smile:
RubyMine 8 Early Access Program is Now Open | JetBrains RubyMine Blog

16
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
12