ruby – zsh:command not found:bundle(gem安装bundle后)

前端之家收集整理的这篇文章主要介绍了ruby – zsh:command not found:bundle(gem安装bundle后)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
为什么找不到zsh:命令找不到:bundle after gem install bundler?

我尝试设置path =(/usr/local/lib/ruby/gems/2.2/gems/~ / bin / bin / sbin /usr/bin/usr / sbin /usr/local / bin /usr/local / sbin) / etc / zshrc和source / etc / zshrc无效.

root@dev:/home/dev# gem install bundler
Successfully installed bundler-1.7.12
Parsing documentation for bundler-1.7.12
Done installing documentation for bundler after 10 seconds
1 gem installed

root@dev:/home/dev# bundle
zsh: command not found: bundle

root@dev:/home/dev# uname -a
OpenBSD dev.my.domain 5.7 GENERIC#748 amd64

root@dev:/home/dev# gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5
  - RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-openbsd]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.2
  - RUBY EXECUTABLE: /usr/local/bin/ruby22
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-openbsd
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.2
     - /usr/local/lib/ruby/gems/2.2/gems/
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/lib/ruby/gems/2.2/gems/
     - /root/bin
     - /bin
     - /sbin
     - /usr/bin
     - /usr/sbin
     - /usr/local/bin
     - /usr/local/sbin

解决方法

您似乎是在系统范围内安装bundler之后.为此,您需要将–no-user-install标志传递给gem并使用sudo执行它:
sudo gem install bundler --no-user-install

之后,您应该看到/usr/bin /中的bundle很好:

$ls /usr/bin/bundle
/usr/bin/bundle*
原文链接:https://www.f2er.com/ruby/272788.html

猜你在找的Ruby相关文章