179
101

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 5 years have passed since last update.

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

Last updated at Posted at 2019-01-05

##環境

$ 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
179
101
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
179
101

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?