没有使用capistrano将String隐式转换为哈希错误

时间:2014-01-12 12:06:50

标签: ruby-on-rails-3.2 capistrano

我正在尝试运行一些capistrano任务(git:check,deploy:check)但它们都以错误结束:

douglas@bilbo:/var/www/odpf$ cap production git:check --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
 INFO [0b976413] Running /usr/bin/env mkdir -p /tmp/odpf/ on phisa-odpf-vd.vserver.nimag.net
DEBUG [0b976413] Command: /usr/bin/env mkdir -p /tmp/odpf/
cap aborted!
no implicit conversion of String into Hash

这是我的Gemfile:

source 'https://rubygems.org'

gem 'rails', '~>3.2'
gem 'pg', '>= 0.14'
gem 'haml-rails' , '~> 0.3'
gem 'execjs'
gem 'therubyracer', :platforms => :ruby

group :development, :test do
  gem 'factory_girl_rails'
end

group :developpement do
  gem 'rspec-rails', '>= 2.11'
  gem 'capistrano-rails', '~>1.1', require: false
  gem 'faker', '>= 1.0'
  gem 'rvm-capistrano'
end

group :test do
  gem 'rspec', '>= 2.11'
  gem 'webrat', '>= 0.7'
  gem 'spork-rails', '>= 3.2'
end

group :assets do
  gem 'sass-rails',   '>= 3.2.3'
  gem 'coffee-rails', '>= 3.2.1'
  gem 'compass-rails', '>= 1.0'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'annotate'

gem 'spreadsheet'
gem 'schema_plus'
gem 'squeel'
gem 'devise'
gem 'role_model'
gem 'declarative_authorization'
gem 'rails-translate-routes'
gem 'validates_timeliness'

我不知道现在在哪里搜索

1 个答案:

答案 0 :(得分:0)

错误来自我的/config/deploy/production.rb 我使用不正确的数组语法来编写哈希。

我替换了这一行:

server 'myserver.net', user: 'deploy', roles: %w{web app db}, ssh_options: %w{ forward_agent: false, port: 8888 }

使用这些行,它可以工作:

server 'myserver.net', user: 'deploy', roles: %w{web app db}

set :ssh_options, {
  forward_agent: false,
  port: 8888
}

我也注意到我使用了错误的宝石:

# For Capistrano 2.x
gem 'rvm-capistrano'

所以我为此改变了它:

# For Capistrano 3.x
gem 'capistrano-rvm'