2014-01-12 51 views
0

我試圖運行Capistrano的一些任務(GIT:檢查,部署:檢查),但他們有錯誤全部結束:字符串的隱式轉換與Capistrano的哈希錯誤

[email protected]:/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' 

我不知道在哪裏,現在

回答

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' 
相關問題