0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

bundle installのエラー

Last updated at Posted at 2020-10-25

エラーが起きました

Gemfileに使いたいGemを記載してbundle installっと!
あれっ、

ターミナル
You have requested:
  listen >= 3.0.5, < 3.2

The bundle currently has listen locked at 3.2.1.
Try running `bundle update listen`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`

おおう…
なんて書いてあるんだ…

私は英語ができないのでGoogle翻訳さんに任せてみます

ターミナル
あなたは要求しました
  リッスン> = 3.0.5<3.2

バンドルは現在3.2.1でリッスンロックされています
`bundle updatelisten`を実行してみてください

Gemfile内の複数のgemを一度に更新する場合は
それらすべてを `bundleupdate`に渡してみてください

とGoogle翻訳さんは申されました。

どういうことかというと、
このlistenというGemのバージョンは3.0.5以上、3.2未満というバージョンで指定していて、bundle側は3.2.1しか対応してないよ〜だからupdateしてよ〜
と言っているとういうことですかね

解決策

これはターミナルさんに言われた通りに

ターミナル
bundle update

これやってからbundle installすれば解決しました
どうやらRailsとBundlerのサポートしているバージョンが異なればこういうことが起きるそうです

iPhoneユーザーなら似た様な経験ある人いるんじゃないですかね

「iOSの新バージョン出たからアップデートしよっ」
「よしアップデート終わったな、ゲームでもするか」
「あれっ、アプリが起動しない…」

これも最新iOSとアプリのバージョンが対応していないから起きる現象なようです
だから最新バージョンが出たからといって無闇にアップデートしない方が良いと言われていますよね(私は速攻でやりますけど^o^)

バージョンなんて新しい方がいいに決まってんじゃん!!
なんて最初は思っていましたが、アップデートしたことにより今まで動いていた機能が動かなくなることはエンジニアの現場ではあるそうですね
新しい物好きの人は要注意です!!

bundle installとbundle updateの使い方

bundle installというのはGemfile.lockを元にGemをインストールする
Gemfile記載あり、Gemfile.lockに記載ないという場合に、対象のGemをインストールした後、Gemfile.lockを更新する

bundle updateというのはGemfileを元にGemをインストールして、Gemfile.lockを更新する

結局Gemfile.lockが更新されないとアプリには反映されないんですね
よく触るのはGemfileだけど、最終決定権はGemfile.lockに委ねられるって感じで認識してます

参考

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?