LoginSignup
171
139

More than 5 years have passed since last update.

bundle install すると Could not find xxx in any of the sources と怒られる場合の対処法

Posted at

問題

gitから新しくRailsアプリをチェックアウトしてきたり、Rubyのバージョンを上げたりして、 bundle install を実行すると以下のようなエラーが出る。
did_you_mean-0.8.0 の部分は状況によって変わる)

bundle install
Fetching gem metadata from https://rubygems.org/
Could not find did_you_mean-0.8.0 in any of the sources

原因

Gemfile.lock で指定されているgemのバージョンがyank(削除)されてしまっている。

確認方法

http://rubygems.org/ にアクセスして、問題が出ているgemを検索する。

エラーになっているgemのバージョンがリストになければyankされている。

例: http://rubygems.org/gems/did_you_mean

バージョン0.8.0がない。
Screen Shot 2014-12-03 at 8.25.59.png

解決策

対象のgemをupdateする。

bundle update did_you_mean

備考1

バージョンが大きく変わってしまう場合は後方互換性がなくなっているかもしれないので、Gemfileで適切なバージョンを指定してから bundle update する。

gem 'did_you_mean', '~> 0.9.0'

備考2

他にもyankされているgemがある場合は同時にupdateする。

エラーの例

bundle update did_you_mean
Fetching gem metadata from https://rubygems.org/
Could not find jpmobile-4.1.2 in any of the sources

同時にupdate

bundle update did_you_mean jpmobile

参考文献

171
139
1

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
171
139