Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
104
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

@sshuuu

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
104
Help us understand the problem. What are the problem?