【发布时间】:2017-10-04 03:14:03
【问题描述】:
我尝试在我的项目中安装 capistrano gem 并发现错误:
未初始化的常量 Capistrano::Configuration::SSHKit (NameError)
完整日志:
bundle exec cap install
/home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/configuration/server.rb:4:in `<class:Configuration>': uninitialized constant Capistrano::Configuration::SSHKit (NameError)
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/configuration/server.rb:3:in `<module:Capistrano>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/configuration/server.rb:2:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/configuration.rb:4:in `require_relative'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/configuration.rb:4:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/configuration/filter.rb:1:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/configuration/filter.rb:1:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/dsl.rb:5:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/dsl.rb:5:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/all.rb:11:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/lib/capistrano/all.rb:11:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/bin/cap:2:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/capistrano-3.9.1/bin/cap:2:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/bin/cap:22:in `load'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/bin/cap:22:in `<main>'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
from /home/ubuntu/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
Ubuntu 服务器 16.04 红宝石 2.4.0 导轨 5.1.4
如何解决?
UPD 1
ubuntu@rails-serv-1:/var/www/cargo$ bundle exec gem list cap ssh
*** LOCAL GEMS ***
capistrano (3.9.1)
capistrano-bundler (1.3.0)
capistrano-rails (1.3.0)
capistrano-rvm (0.1.2)
capistrano3-puma (3.1.1)
capybara (2.15.2)
invisible_captcha (0.9.3)
*** LOCAL GEMS ***
airbrussh (1.3.0)
net-ssh (4.2.0)
sshkit (1.14.0)
【问题讨论】:
-
你能包含这个命令的输出吗?
bundle exec gem list cap ssh -
@MattBrictson 我添加了输出。
-
您的项目中是否已有
Capfile?如果是这样,请在运行bundle exec cap install之前将其删除。这有什么不同吗? -
@MattBrictson 不,我的项目中没有 Capfile。