LoginSignup
14
16

More than 3 years have passed since last update.

bundle install ができないときの解消法

Posted at

bundle install ができないときの解消法について

アプリ開発中に、bundle installができないという事態に陥ったので、その解消法について、説明する記事です。

注目する点は、bundlerのバージョンの差です。

gemをGemfileに記述し、bundle installを行ったところ、

Traceback (most recent call last):
    2: from /Users/kenta/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
    1: from /Users/kenta/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/Users/kenta/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

bundle installできず、
このようなターミナル上のエラー文が出てきました。

can't find gem bundler

と書いてあります。
調べてみたところ、PCにインストールしたbundlerとGemfile.lock中のbundlerのバージョンが異なることが原因のようです。

Gemfile.lock
BUNDLED WITH
   2.0.1

自分のPC上のbundlerは2.0.2でした。

2.0.2を

gem uninstall bundler -v 2.0.2

アンインストールし、

gem install bundler -v 2.0.1

でバージョンを変更しました。
その後、正常にbundle installすることができました。

14
16
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
14
16