【问题标题】:Undefined method `instance' for Capistrano::Configuration:Class on `cap deploy:setup`Capistrano::Configuration:Class 在“cap deploy:setup”上的未定义方法“instance”
【发布时间】:2014-01-31 01:43:56
【问题描述】:
$ 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 还很陌生,但过去曾成功使用过它,没有遇到这么多问题。有谁知道解决这个问题?

【问题讨论】:

标签: ruby-on-rails ruby capistrano


【解决方案1】:

我对 capistrano 还很陌生,但过去曾成功使用过它,没有遇到这么多问题。有谁知道这个问题的解决办法吗?

我猜你需要继续使用第 2 版,修改 Gemfile 中的行,改为:

gem "capistrano", "~> 2.15.0"

【讨论】:

  • 谢谢,我昨天终于自己搞定了。实施与您建议的解决方案相同的解决方案。因此,我将此标记为答案。感谢您花时间回复。
  • 我收到了类似的错误消息,但堆栈跟踪来自when gem。问题是每当 0.8.x 不能与 capistrano 3.x 一起工作时,所以我升级到了 0.9.0。 @lee-hambley,我建议在 capistranorb.com/documentation/upgrading 处添加任何升级的提及。
  • @IsaacBetesh 建议升级适用于我的任何时候的 gem,而不是降级到 Capistrano 2。
【解决方案2】:

我遇到了同样的问题,但我必须执行几个步骤才能使其正常工作。首先卸载 Capistrano 的所有现有版本(如果您有多个版本,请删除所有版本

sudo gem uninstall Capistrano

然后使用上面给出的文本将Gemfile 添加到您的存储库中

gem "capistrano", "~> 2.15.0"

确保您已安装 bundle

sudo gem install bundler

终于安装了

sudo bundle install

【讨论】:

    猜你喜欢
    • 2013-10-22
    • 1970-01-01
    • 1970-01-01
    • 2012-03-15
    • 2015-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多