sudo bundle 导致“找不到捆绑器”错误
sudo bundle causes `could not find bundler` error
我有 bundle exec
工作正常,但是当我尝试执行 sudo bundle exec
时,我有 Could not find 'bundler' (>= 0)
错误。
这是完整的错误信息。
smcho@macho appname> sudo bundle exec unicorn -c config/unicorn.rb -E production -D
/Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 11 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/smcho/.gem/ruby/2.2.0:/Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0', execute `gem env` for more information
from /Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
from /Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /Users/smcho/.rvm/gems/ruby-2.2.3/bin/bundle:22:in `<main>'
from /Users/smcho/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
from /Users/smcho/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
我发现很多 questions/answers 与此问题相关,但似乎没有任何效果。
- Using $ sudo bundle exec ... raises 'bundle: command not found' error
- 我尝试了这个 post 的答案,但没有任何效果。反正我的错误信息不是
bundle: command not found
。
- Why is sudo: bundle command not found?
$ echo 'echo $PATH' | sh
和 $ echo 'echo $PATH' | sudo sh
的结果相同
为了使用bundle
命令,您需要先安装bundler
:
sudo gem install bundler
然后你就可以使用bundle
命令:
sudo bundle exec . . .
查看 bundler official page 了解更多信息。
我有 bundle exec
工作正常,但是当我尝试执行 sudo bundle exec
时,我有 Could not find 'bundler' (>= 0)
错误。
这是完整的错误信息。
smcho@macho appname> sudo bundle exec unicorn -c config/unicorn.rb -E production -D
/Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 11 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/smcho/.gem/ruby/2.2.0:/Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0', execute `gem env` for more information
from /Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
from /Users/smcho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /Users/smcho/.rvm/gems/ruby-2.2.3/bin/bundle:22:in `<main>'
from /Users/smcho/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
from /Users/smcho/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
我发现很多 questions/answers 与此问题相关,但似乎没有任何效果。
- Using $ sudo bundle exec ... raises 'bundle: command not found' error
- 我尝试了这个 post 的答案,但没有任何效果。反正我的错误信息不是
bundle: command not found
。
- 我尝试了这个 post 的答案,但没有任何效果。反正我的错误信息不是
- Why is sudo: bundle command not found?
$ echo 'echo $PATH' | sh
和$ echo 'echo $PATH' | sudo sh
的结果相同
为了使用bundle
命令,您需要先安装bundler
:
sudo gem install bundler
然后你就可以使用bundle
命令:
sudo bundle exec . . .
查看 bundler official page 了解更多信息。