我正在执行以下脚本:
gem install rdoc --no-document
gem install bundle
bundle
输出:
+ gem install rdoc --no-document
Successfully installed rdoc-6.1.1
1 gem installed
+ gem install bundle
Successfully installed bundle-0.0.1
Parsing documentation for bundle-0.0.1
Done installing documentation for bundle after 2 seconds
1 gem installed
1 gem installed
+ bundle install
/usr/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)
from /usr/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
from /srv/myuser/.gem/ruby/2.5.0/bin/bundle:23:in `<main>'
我已经添加/srv/myuser/.gem/ruby/2.5.0/bin
了自己的路径,因此能够安装gems。
该gem env
节目
RubyGems Environment:
- RUBYGEMS VERSION: 2.7.7
- RUBY VERSION: 2.5.1 (2018-03-29 patchlevel 57) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/2.5.0
- USER INSTALLATION DIRECTORY: /srv/myuser/.gem/ruby/2.5.0
- RUBY EXECUTABLE: /usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- SPEC CACHE DIRECTORY: /srv/myuser/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/2.5.0
- /srv/myuser/.gem/ruby/2.5.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--user-install"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/sbin
- /usr/local/bin
- /usr/bin
gem list
显示已安装的宝石。执行以下操作时,我也可以找到捆绑软件:
ls -ltrah /srv/myuser/.gem/ruby/2.5.0/bin
我也尝试安装捆绑器,但这也无济于事。我究竟做错了什么?
gem which bundle
什么也没显示。gem spec bundle
正在显示它。
更新:我尝试在运行捆绑软件之前安装捆绑软件,但在以下情况下出现相同的问题:
gem list bundle
表演
bundle (0.0.1)
bundler (2.0.1)
Gemfile.lock
并再次运行捆绑软件安装