rails Could not find xxxxx in any of the sources (Bundler::GemNotFound)

railsでサーバを起動したら以下のエラーが発生

/Users/yukiyoshimura/.rbenv/versions/2.2.3/bin/ruby -e stdout.sync=true;stdout.sync=true;stderr.sync=true;load($0=ARGV.shift) /Applications/develop/workspace/WantIt/bin/rails server -b 0.0.0.0 -p 3000 -e development
/Users/yukiyoshimura/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find font-awesome-rails-4.7.0.4 in any of the sources (Bundler::GemNotFound)

エラーの原因

gemが見つけられない。
探しにいった場所はxxバージョン(上記は2.2.3の配下)ということがわかる

gemを探しにいっている場所が正しいかの確認

以下を実施

gem environment
コマンドの結果
RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.14.1
  - RUBY VERSION: 2.4.4 (2018-03-28 patchlevel 296) [x86_64-darwin16]
  - INSTALLATION DIRECTORY: /Users/yukiyoshimura/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0
  - USER INSTALLATION DIRECTORY: /Users/yukiyoshimura/.gem/ruby/2.4.0
  - RUBY EXECUTABLE: /Users/yukiyoshimura/.rbenv/versions/2.4.4/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/yukiyoshimura/.rbenv/versions/2.4.4/bin
  - SPEC CACHE DIRECTORY: /Users/yukiyoshimura/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/yukiyoshimura/.rbenv/versions/2.4.4/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-16
  - GEM PATHS:
     - /Users/yukiyoshimura/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0
     - /Users/yukiyoshimura/.gem/ruby/2.4.0

わかったこと

・サーバ起動時に探しにいっていたパス:2.2.3配下
・gemのパス2.4.4(bundle installするとこの配下にgemが配置されているはず)

対応

サーバ起動はIDE(RubyMine)で行っていたのでRubymineの設定からRuby SDK and Gemsの設定を2.4.4にすることで解決

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.