2011-10-15 48 views
0

我目前正在將我的2.3.8 rails應用程序轉換爲3.1。Rails 3查詢 - 錯誤的參數數量(1爲0)

錯誤:

wrong number of arguments (1 for 0) 
app/controllers/application_controller.rb:22:in `footer' 

代碼:

@system_message = Constant.where(:key => "system_message").first 

第一所有方法出現此錯誤,在任何模型。

即使有這些:

Episode.where(:id => 1).first 
Episode.first 
Episode.all 

設置:

  • 的Ruby 1.9.2
  • Rails的3.1.1.rc3

的Gemfile:

source "http://rubygems.org" 
source "http://gemcutter.org/" 
source "http://gems.github.com/" 

#Main 
gem "rails", "3.1.1.rc3" 
#gem "rails", :git => "git://github.com/rails/rails.git" 

#System 
gem "mysql2" 
gem "therubyracer", require: "v8" 

#Tools 
gem "capistrano" 
gem "hoptoad_notifier" 
gem "whenever" 

#Application 
gem "jquery-rails" 
gem "hpricot" 
gem "ar-extensions" 
gem "gravtastic" 
gem "will_paginate" 
gem "time_diff" 
gem "has_permalink" 

#Email 
gem "adzap-ar_mailer"#, :lib => "action_mailer/ar_mailer" 
gem "ambethia-smtp-tls"#, :lib => "smtp-tls" 

#Devise 
gem "devise" 
gem "warden" 

group :assets do 
    gem "sass-rails", "~> 3.1.4" 
    gem "coffee-rails", "~> 3.1.1" 
    gem "uglifier", ">= 1.0.3" 
end 

group :development do 
    gem "bullet" 
end 

group :test do 
    gem "turn", :require => false 
end 

回答

0

找到了!

Rails 3不支持gem「ar-extensions」。
更改爲「activerecord-import」gem。

相關問題