2014-09-04 19 views
0

我的部署腳本拋出錯誤。我使用的斯特拉努和寶石railsless-deployCapistrano - method_missing地圖

錯誤: /var/lib/gems/1.9.1/gems/capistrano-2.15.5/lib/capistrano/configuration/namespaces.rb:193:in `method_missing': undefined method `map' for #<Capistrano::Configuration::Namespaces::Namespace:0x00000001a634b0> (NoMethodError)

我Capfile

require 'rubygems' 
require 'railsless-deploy' 
# load 'deploy' 

load 'app/config/deploy' 

我deploy.rb

#...more code...# 
set :myfiles, ["path/to/file.ext","path/to/another/file.ext"] 
#...more code...# 
namespace :myfiles do 
    task :check do 
     myfiles.map do |file| 
      #...more code...# 
     end 
    end 
end 

ruby -v ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

cap -V Capistrano v2.15.5

回答

0

您有一個變量myfiles,然後範圍幾行後覆蓋。這就是爲什麼capistrano試圖將map方法發送到名稱空間並失敗的原因。將列表名稱更改爲其他內容:

set :file_list, ["path/to/file.ext","path/to/another/file.ext"] 
#...more code...# 
namespace :myfiles do 
    task :check do 
     file_list.map do |file| 
      #...more code...# 
     end 
    end 
end 
+0

thaks!這個權利! – sav 2014-09-04 19:28:31