web-dev-qa-db-ja.com

rbenv — 'find_spec_for_exe':実行可能バンドル(Gem :: GemNotFoundException)を持つgemバンドル(> = 0.a)が見つかりません

私はrbenvに慣れていません(RVMを長い間使用していました)。今日、私は自分のRVMをクリーンにアンインストールし、rbenvをインストールします。私は何とか問題なくRuby 2.5.1をインストールすることができました。

しかし、今日プロジェクトで_bundle install_を実行しようとすると、次のエラーが発生しました。

'find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

バンドラーのインストールで何かが壊れているようですが、何が悪いのかわかりません。 _gem install bundler_をSudoで実行しても問題は解決しません。

ここに完全なトレースがあります:

_$ echo $Shell
/bin/zsh


$ cat ~/.gemrc
gem: --no-document
install: --no-document
update: --no-document


$ rbenv versions
  system
* 2.5.1 (set by /Users/zulh/.rbenv/version)


$ Ruby -v
Ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16]


$ which Ruby
/Users/zulh/.rbenv/shims/Ruby


$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.7.6
  - Ruby VERSION: 2.5.1 (2018-03-29 patchlevel 57) [x86_64-darwin16]
  - INSTALLATION DIRECTORY: /Users/zulh/.rbenv/versions/2.5.1/lib/Ruby/gems/2.5.0
  - USER INSTALLATION DIRECTORY: /Users/zulh/.gem/Ruby/2.5.0
  - Ruby EXECUTABLE: /Users/zulh/.rbenv/versions/2.5.1/bin/Ruby
  - EXECUTABLE DIRECTORY: /Users/zulh/.rbenv/versions/2.5.1/bin
  - SPEC CACHE DIRECTORY: /Users/zulh/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/zulh/.rbenv/versions/2.5.1/etc
  - RUBYGEMS PLATFORMS:
    - Ruby
    - x86_64-darwin-16
  - GEM PATHS:
     - /Users/zulh/.rbenv/versions/2.5.1/lib/Ruby/gems/2.5.0
     - /Users/zulh/.gem/Ruby/2.5.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
     - "install" => "--no-document"
     - "update" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - Shell PATH:
     - /Users/zulh/.rbenv/versions/2.5.1/bin
     - /usr/local/Cellar/rbenv/1.1.1/libexec
     - /Users/zulh/.rbenv/shims
     - /usr/local/bin
     - /Users/zulh/go/bin
     - /usr/local/bin
     - /Users/zulh/go/bin
     - /Users/zulh/.rbenv/shims
     - /usr/local/bin
     - /Users/zulh/go/bin
     - /Users/zulh/.rbenv/shims
     - /usr/local/bin
     - /Users/zulh/go/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Library/Frameworks/Mono.framework/Versions/Current/Commands
     - /Applications/Postgres.app/Contents/Versions/latest/bin
     - /Users/zulh/projects/tifig/build/tifig
     - /Applications/Postgres.app/Contents/Versions/latest/bin
     - /Users/zulh/projects/tifig/build/tifig
     - /Applications/Postgres.app/Contents/Versions/latest/bin
     - /Users/zulh/projects/tifig/build/tifig
     - /Applications/Postgres.app/Contents/Versions/latest/bin
     - /Users/zulh/projects/tifig/build/tifig
     - /Applications/Postgres.app/Contents/Versions/latest/bin


$ which bundler
/Users/zulh/.rbenv/shims/bundler


$ bundler --version
Traceback (most recent call last):
    2: from /Users/zulh/.rbenv/versions/2.5.1/bin/bundler:23:in `<main>'
    1: from /Users/zulh/.rbenv/versions/2.5.1/lib/Ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/Users/zulh/.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 bundler (Gem::GemNotFoundException)


$ cd projects/www.Ruby-lang.org


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


$ Sudo gem install bundler
Password:
Successfully installed bundler-2.0.1
1 gem installed


$ which bundler
/Users/zulh/.rbenv/shims/bundler


$ bundler --version
Traceback (most recent call last):
    2: from /Users/zulh/.rbenv/versions/2.5.1/bin/bundler:23:in `<main>'
    1: from /Users/zulh/.rbenv/versions/2.5.1/lib/Ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/Users/zulh/.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 bundler (Gem::GemNotFoundException)


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

この問題を修正する方法は?

注:OSX 10.12.6を使用しています

11

Rbenv 1.1.1とRuby 2.5.1を使用しており、bundle installの実行中に同じエラーが発生しました。gem update --systemが問題を解決しました

0
Lana Dz