Capistrano :: Configuration的未定义方法`instance':`cap deploy:setup`上的类

时间:2013-10-31 12:33:51

标签: ruby-on-rails ruby capistrano

$ bundle exec cap deploy:setup
/Users/development/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-1.1.0/lib/sshkit.rb:3: 
  warning: already initialized constant SSHKit::StandardError
/Users/development/.rvm/gems/ruby-2.0.0-p247@global/gems/sshkit-1.1.0/lib/sshkit.rb:3: 
  warning: previous definition of StandardError was here

cap aborted!
undefined method `instance' for Capistrano::Configuration:Class
/Users/development/.rvm/gems/ruby-2.0.0-p247@global/gems/railsless-deploy-1.1.2/lib/railsless-deploy.rb:1:in `<top (required)>'
/Users/development/Sites/singapore/Capfile:1:in `require'
/Users/development/Sites/singapore/Capfile:1:in `<top (required)>'
/Users/development/.rvm/gems/ruby-2.0.0-p247@global/gems/capistrano-3.0.0/lib/capistrano/application.rb:22:in `load_rakefile'
/Users/development/.rvm/gems/ruby-2.0.0-p247@global/gems/capistrano-3.0.0/lib/capistrano/application.rb:12:in `run'
/Users/development/.rvm/gems/ruby-2.0.0-p247@global/gems/capistrano-3.0.0/bin/cap:3:in `<top (required)>'

我对capistrano相当新,但过去成功使用它没有这么多问题。有谁知道解决这个问题?

2 个答案:

答案 0 :(得分:2)

  

我对capistrano相当新,但过去成功使用它没有这么多问题。有谁知道解决这个问题吗?

我想您需要继续使用版本2,修改Gemfile中的行,以便阅读以下内容:

gem "capistrano", "~> 2.15.0"

答案 1 :(得分:0)

我遇到了同样的问题,但我必须采取一些措施才能让它发挥作用。首先卸载所有现有版本的Capistrano(如果您有多个版本,请删除所有版本

sudo gem uninstall Capistrano

然后使用上面给出的文字

为您的回购添加Gemfile
gem "capistrano", "~> 2.15.0"

确保您已安装bundle

sudo gem install bundler

终于安装

sudo bundle install