I have bundle exec
works fine, but when I'm trying to execute sudo bundle exec
, I have Could not find 'bundler' (>= 0)
error.
This is the full error message.
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>'
I found many questions/answers related to this issue, but nothing seems to work.
- Using $ sudo bundle exec ... raises 'bundle: command not found' error
- I tried the answers from this post, but nothing works. Anyway, my error message is not
bundle: command not found
.
- I tried the answers from this post, but nothing works. Anyway, my error message is not
- Why is sudo: bundle command not found?
- I have same results from both
$ echo 'echo $PATH' | sh
and$ echo 'echo $PATH' | sudo sh
- I have same results from both