cap deploy:setup bash: /usr/bin/cap: No such file or directory
I am getting this error
cap deploy:setup
bash: /usr/bin/cap: No such file or directory
gem list:--
capistrano (2.5.19)
capistrano-ext (1.2.1)
Previously i was getting an issue like:--
cap deploy:setup
/usr/lib/ruby/1.8/capistrano/config开发者_运维知识库uration/loading.rb:152:in `require': no such file to load -- capistrano/ext/multistage (LoadError)
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:152:in `require'
from ./config/deploy.rb:2:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from Capfile:3:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `each'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:30:in `execute!'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:14:in `execute'
from /usr/bin/cap:4
So i did:--
sudo gem uninstall capistrano
sudo rm -rf /usr/bin/cap
sudo gem install capistrano-ext
sudo gem install capistrano
so i m getting the eror i specified earlier:--
cap deploy:setup
bash: /usr/bin/cap: No such file or directory
How can fix this issue. I am not able to find this using google etc.
If you are using bundler, try executing in the bundle context:
bundle exec cap deploy:setup
remove both the gems and install it again..
I'm going to guess that ls -l /usr/bin/cap
actually shows a small file there.
Capistrano is written in Ruby and the first line of the file will be a shebang that probably references the Ruby interpreter with an absolute path name.
Type head -1 cap
or cat cap
and see if the Ruby interpreter is really located where the cap
script thinks it is. If not, you can install a gem on top of itself, so just install capistrano again.
精彩评论