设计错误数量的参数(2 对 1)

Devise wrong number of arguments (2 for 1)

Existing issue 存在一个问题,我在升级到 rails 4.2.0 后收到确切的错误。

上述问题是 deviseclearance 之间的冲突,但我没有使用 clearance。我怀疑我的某些 gem 导致了问题。 这是我的代码:

gemfile

source 'https://rubygems.org'

gem 'rails', '4.2.0'
gem 'sass-rails', '~> 4.0.0'
gem "figaro"
gem 'nokogiri'

gem 'bootstrap-editable-rails'
gem 'devise'
gem 'devise_token_auth' 
gem 'devise_invitable', '~> 1.3.3'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'redis'
gem 'switch_user', '0.9.4'
gem 'websocket-rails', '0.6.2'
gem 'twilio-ruby', '~> 3.11'

gem 'aasm'
gem 'acts_as_tenant'
gem 'activerecord-postgresql-adapter'
gem 'annotate', '>=2.6.0'
gem 'chronic_duration'
gem 'attribute-defaults'
gem 'groupdate'
gem 'hairtrigger'
gem 'money-rails'
gem 'nilify_blanks'
gem 'pacecar'
gem 'paranoid2'
gem 'schema_plus'
gem 'time_ago_in_words'
gem 'validates_timeliness', '~> 3.0'
gem 'spreadsheet'

gem 'client_side_validations', github: 'DavyJonesLocker/client_side_validations'
gem 'client_side_validations-simple_form', github: 'DavyJonesLocker/client_side_validations-simple_form'
gem 'kaminari'
gem 'rails-timeago', '~> 2.0'
gem 'simple_form'
gem 'slim-rails'
gem 'twitter-bootstrap-rails', :github => 'seyhunak/twitter-bootstrap-rails', :branch => :bootstrap3
gem 'jquery-datatables-rails', '~> 2.2.3'
gem 'jquery-turbolinks'
gem 'twitter-bootstrap-calendar'

gem 'dust-rails', '0.4.0'
gem 'coffee-rails'
gem 'execjs'
gem 'gon'
gem 'jbuilder', '~> 1.2'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'less-rails'
gem 'remotipart', '~> 1.2'
gem 'therubyracer', platforms: :ruby
gem 'twitter-bootstrap-rails-confirm', github: 'bluerail/twitter-bootstrap-rails-confirm', branch: 'bootstrap3'
gem 'turbolinks'
gem 'uglifier', '>= 1.3.0'

gem 'paperclip', '~> 3.5.0'

gem 'sidekiq'
gem 'sinatra', '>= 1.3.0', :require => nil
gem 'whenever', :require => false

gem 'liquid'

group :doc do
  gem 'sdoc', require: false
end

group :development do
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'capistrano', '~> 3.1'
  gem 'capistrano-rails', '~> 1.1'
  gem 'capistrano-ext'
  gem 'capistrano-rvm'
  gem 'capistrano-bundler'
  gem 'letter_opener'
  gem 'quiet_assets'
  gem 'pry', '~> 0.10.0'
  gem 'brakeman', :require => false
  gem 'meta_request'
end

group :test do
  gem 'email_spec'
  gem 'minitest'
end

首先从 application 中删除 devise

然后做一个 bundle install .

最后,install 再次设计。

这行得通。

如果您使用的是 Turbolinks,请尝试更新 turbolinks gem。从 Rails 4.1 升级到 4.2 并遇到此问题后,这为我解决了这个问题。