cap deploy:setup bash:/ usr / bin / cap:没有这样的文件或目录

时间:2011-01-05 00:16:17

标签: ruby-on-rails deployment ruby-on-rails-3 capistrano

我收到此错误

cap deploy:setup
bash: /usr/bin/cap: No such file or directory

宝石清单: -

capistrano (2.5.19)
capistrano-ext (1.2.1)

以前我遇到的问题是: -

 cap deploy:setup
/usr/lib/ruby/1.8/capistrano/configuration/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

所以我做了: -

 sudo gem uninstall capistrano
 sudo rm -rf /usr/bin/cap
 sudo gem install capistrano-ext
 sudo gem install capistrano

所以我得到了我之前指定的错误: -

cap deploy:setup
bash: /usr/bin/cap: No such file or directory

如何解决此问题。我无法使用谷歌等找到它。

3 个答案:

答案 0 :(得分:1)

如果您使用的是bundler,请尝试在bundle上下文中执行:     bundle exec cap deploy:setup

答案 1 :(得分:0)

我猜测ls -l /usr/bin/cap实际上在那里显示了一个小文件。

Capistrano是用Ruby和the first line of the file will be a shebang编写的,它可能引用了带有绝对路径名的Ruby解释器。

键入head -1 capcat cap,看看Ruby解释器是否真正位于cap脚本认为的位置。如果没有,你可以在它自己的顶部安装一个宝石,所以只需再次安装capistrano。

答案 2 :(得分:0)

删除两个宝石并重新安装..