1

尝试运行时cap deploy:check出现此错误:

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host #<SSHKit::Host:0x007fc04888dcf8>: undefined local variable or method `rubber_env' for #<SSHKit::Backend::Netssh:0x007fc04888d050>

NameError: undefined local variable or method `rubber_env' for #<SSHKit::Backend::Netssh:0x007fc04888d050>

(See full trace by running task with --trace)

头文件

gemfile = File.expand_path(File.join(__FILE__, '..', 'Gemfile'))
if File.exist?(gemfile) && ENV['BUNDLE_GEMFILE'].nil?
  puts "Respawning with 'bundle exec'"
  exec("bundle", "exec", "cap", *ARGV)
end

load 'deploy' if respond_to?(:namespace) # cap2 differentiator

env = ENV['RUBBER_ENV'] ||= (ENV['RAILS_ENV'] || 'production')
root = File.dirname(__FILE__)

# this tries first as a rails plugin then as a gem
$:.unshift "#{root}/vendor/plugins/rubber/lib/"
require 'rubber'

Rubber::initialize(root, env)
require 'capistrano'

require 'capistrano-passenger'
require 'bundler'
require 'rails'

Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy.rb'

我想我通过放入set :rubber_envdeploy.rb 解决了这个问题,但现在我收到了这个错误

cap aborted!
ArgumentError: wrong number of arguments (1 for 2)
/Users/user1/app1/Capfile:24:in `load'
/Users/user1/app1/Capfile:24:in `<top (required)>'
4

0 回答 0