终端开始时 Gem 路径损坏 Mac OS X
Broken Gem Path on Terminal Start Mac OS X
打开新终端时我得到:
Traceback (most recent call last):
3: from /usr/local/bin/bundle:22:in `<main>'
2: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
1: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/dependency.rb:323:in `to_spec'
/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'bundler' (>= 0) among 7 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/tkellogg/.gem/ruby/2.6.0:/usr/local/lib/ruby/gems/2.6.0:/usr/local/Cellar/ruby/2.6.5/lib/ruby/gems/2.6.0', execute `gem env` for more information
Bash个人资料看起来像:
. ~/.bashrc
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
bashrc 看起来像;
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
我已经将默认系统 ruby 设置为 2.6.5 并且我已经升级了自制软件。
有什么想法吗?
运行 bundle update --bundler
给出 env: ruby: Argument list too long
这是gem env
的结果:
Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0
Error loading RubyGems plugin "/Users/me/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/gem-wrappers-1.4.0/lib/rubygems_plugin.rb": cannot load such file -- gem-wrappers (LoadError)
RubyGems Environment:
- RUBYGEMS VERSION: 3.1.2
- RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin18]
- INSTALLATION DIRECTORY: /Users/me/.gem
- USER INSTALLATION DIRECTORY: /Users/me/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /Users/me/.gem/bin
- SPEC CACHE DIRECTORY: /Users/me/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-18
- GEM PATHS:
- /Users/me/.gem
- /Users/me/.rvm/gems/ruby-2.6.5
- /Users/me/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/local/sbin
- /Users/me/anaconda3/bin
- /Users/me/.node/bin
- /Users/me/.yarn/bin
- /Users/me/.nvm/versions/node/v10.14.1/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/bin
- /Users/me/go
- /Users/me/go/bin
- /Library/Frameworks/Python.framework/Versions/3.6/bin
- ~/npm-global/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/bin
- /Users/me/go
- /Users/me/go/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.rvm/gems/ruby-2.6.5/bin
- /Users/me/.rvm/gems/ruby-2.6.5@global/bin
- /Users/me/.rvm/rubies/ruby-2.6.5/bin
- /Users/me/.rvm/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- ~/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/go/bin
- /Users/me/anaconda3/bin
- /Users/me/.node/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/go
- /Users/me/go/bin
- /Library/Frameworks/Python.framework/Versions/3.6/bin
- ~/npm-global/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/local/heroku/bin
- /usr/local/mysql/bin
- /usr/local/mysql/bin
- /Users/me/.rvm/bin
- /Users/me/.rvm/bin
- /Users/me/.rvm/bin
- /Users/me/.rvm/bin
看起来您可能已经安装了 ruby Homebrew,但您正在尝试使用 RVM,这可能会导致问题。如果是这种情况,您可能应该重新开始。
先卸载RVM
rvm implode
然后卸载ruby
brew uninstall ruby
然后重新安装 RVM 见 https://rvm.io/rvm/install
更新基于你的 gem env
你的 PATH
变量显然是乱七八糟的。您可以尝试通过查看 this question also you can try this solution 的答案来修复它。但是,只设置一个新的用户帐户并从新的 shell 设置开始,然后重新运行上述步骤可能会更容易。
打开新终端时我得到:
Traceback (most recent call last):
3: from /usr/local/bin/bundle:22:in `<main>'
2: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
1: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/dependency.rb:323:in `to_spec'
/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'bundler' (>= 0) among 7 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/tkellogg/.gem/ruby/2.6.0:/usr/local/lib/ruby/gems/2.6.0:/usr/local/Cellar/ruby/2.6.5/lib/ruby/gems/2.6.0', execute `gem env` for more information
Bash个人资料看起来像:
. ~/.bashrc
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
bashrc 看起来像;
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
我已经将默认系统 ruby 设置为 2.6.5 并且我已经升级了自制软件。
有什么想法吗?
运行 bundle update --bundler
给出 env: ruby: Argument list too long
这是gem env
的结果:
Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0
Error loading RubyGems plugin "/Users/me/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/gem-wrappers-1.4.0/lib/rubygems_plugin.rb": cannot load such file -- gem-wrappers (LoadError)
RubyGems Environment:
- RUBYGEMS VERSION: 3.1.2
- RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin18]
- INSTALLATION DIRECTORY: /Users/me/.gem
- USER INSTALLATION DIRECTORY: /Users/me/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /Users/me/.gem/bin
- SPEC CACHE DIRECTORY: /Users/me/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-18
- GEM PATHS:
- /Users/me/.gem
- /Users/me/.rvm/gems/ruby-2.6.5
- /Users/me/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/local/sbin
- /Users/me/anaconda3/bin
- /Users/me/.node/bin
- /Users/me/.yarn/bin
- /Users/me/.nvm/versions/node/v10.14.1/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/bin
- /Users/me/go
- /Users/me/go/bin
- /Library/Frameworks/Python.framework/Versions/3.6/bin
- ~/npm-global/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/bin
- /Users/me/go
- /Users/me/go/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.rvm/gems/ruby-2.6.5/bin
- /Users/me/.rvm/gems/ruby-2.6.5@global/bin
- /Users/me/.rvm/rubies/ruby-2.6.5/bin
- /Users/me/.rvm/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/bin
- /usr/local/heroku/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- ~/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/go/bin
- /Users/me/anaconda3/bin
- /Users/me/.node/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/bin
- /Users/me/.gvm/gos/go1.8.3/bin
- /Users/me/.gvm/pkgsets/go1.8.3/global/overlay/bin
- /Users/me/.gvm/bin
- /Users/me/go
- /Users/me/go/bin
- /Library/Frameworks/Python.framework/Versions/3.6/bin
- ~/npm-global/bin
- /Users/me/.yarn/bin
- /Users/me/bin
- /usr/local/heroku/bin
- /usr/local/mysql/bin
- /usr/local/mysql/bin
- /Users/me/.rvm/bin
- /Users/me/.rvm/bin
- /Users/me/.rvm/bin
- /Users/me/.rvm/bin
看起来您可能已经安装了 ruby Homebrew,但您正在尝试使用 RVM,这可能会导致问题。如果是这种情况,您可能应该重新开始。
先卸载RVM
rvm implode
然后卸载ruby
brew uninstall ruby
然后重新安装 RVM 见 https://rvm.io/rvm/install
更新基于你的 gem env
你的 PATH
变量显然是乱七八糟的。您可以尝试通过查看 this question also you can try this solution 的答案来修复它。但是,只设置一个新的用户帐户并从新的 shell 设置开始,然后重新运行上述步骤可能会更容易。