Help us understand the problem. What is going on with this article?

can't find gem bundler (>= 0.a) with executable bundle 対応

環境

$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
$ which bundler
/Users/sshuuu/.rbenv/shims/bundler

試み

既存のRailsプロジェクトをcloneしてきて、
bundle install --path vendor/bundle をしたい。

発生した問題

$ bundle install --path vendor/bundle

Traceback (most recent call last):
    2: from /Users/sshuuu/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
    1: from /Users/sshuuu/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/Users/sshuuu/.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)

bundlerもruby 2.5.1 の環境でインストールされており、問題なさそうだがエラーが発生する。

原因

Gemfile.lockに記載されているBUNDLE_WITH(1.16.1)のバージョンがインストールされているbundlerのバージョン(2.0.1)と異なっていることが原因だった。

解決策

ruby 2.5.1環境の下、

$ gem install bundler -v 1.16.1
$ gem uninstall bundler -v 2.0.1
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした