0
I`ve剛剛升級的應用程序版本的軌道從3.0.9到3.1.2 &也從紅寶石1.8.7切換到1.9.2服務器。當試圖運行Rails崩潰的耙
試圖運行我得到下面的錯誤信息更新後,服務器:
rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb:65:in `directory': wrong number of arguments (0 for 1) (ArgumentError)
from /Users/Big_Bird/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb:165:in `directory'
from /Users/Big_Bird/apps/Example/vendor/plugins/calendar_date_select/init.rb:12:in `block (2 levels) in <class:Plugin>'
from /Users/Big_Bird/apps/Example/vendor/plugins/calendar_date_select/init.rb:11:in `each'
from /Users/Big_Bird/apps/Example/vendor/plugins/calendar_date_select/init.rb:11:in `block in <class:Plugin>'
現在在哪兒該插件發生錯誤的片段是:
%w[calendar_date_select includes_helper].each { |file|
require File.join(File.dirname(__FILE__), "lib",file)
}
ActionView::Helpers::FormHelper.send(:include, CalendarDateSelect::FormHelper)
ActionView::Base.send(:include, CalendarDateSelect::FormHelper)
ActionView::Base.send(:include, CalendarDateSelect::IncludesHelper)
# install files
unless File.exists?(Rails.root + '/public/javascripts/calendar_date_select/calendar_date_select.js')
['/public', '/public/javascripts/calendar_date_select', '/public/stylesheets/calendar_date_select', '/public/images/calendar_date_select', '/public/javascripts/calendar_date_select/locale'].each do |dir|
source = File.join(directory,dir)
dest = Rails.root + dir
FileUtils.mkdir_p(dest)
FileUtils.cp(Dir.glob(source+'/*.*'), dest)
end
end
我真的不很確定問題出在哪裏,因爲插件中列出的所有目錄都是正確的,升級時我不得不從使用RAILS_ROOT切換到Rails.root,但這就是它。
我希望有關如何解決此問題的任何指導。
在'source = File.join(directory,dir)'這一行中,'directory'是什麼?它看起來像一個局部變量,但我沒有看到它在任何地方聲明。 – Zajn