gpt4 book ai didi

ruby - zsh : command not found: bundle (after gem install bundle)

转载 作者:数据小太阳 更新时间:2023-10-29 06:31:18 24 4
gpt4 key购买 nike

为什么 zsh: command not found: bundlegem 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/zshrcsource/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

最佳答案

我在使用 zsh 时遇到了同样的问题,这解决了它:

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
$ echo 'source $HOME/.zshenv' >> ~/.zshrc
$ exec $SHELL

关于ruby - zsh : command not found: bundle (after gem install bundle),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28072128/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com