0

当我尝试运行 DB:Rake 时出现此错误:

** Invoke db:migrate (first_time)
** Invoke environment (first_time) 
** Execute environment
Resolved collector.newrelic.com to 204.93.223.153
 rake aborted!
 undefined method `confirm_within=' for Devise:Module
 /Users/jasonvdm/development/rails/config/initializers/devise.rb:66:in `block in <top   (required)>'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/devise-2.1.2/lib/devise.rb:247:in    `setup'
 /Users/jasonvdm/development/rails/config/initializers/devise.rb:3:in `<top (required)>'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `block in load'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/engine.rb:556:in `block (2 levels) in <class:Engine>'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/engine.rb:555:in `each'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/engine.rb:555:in `block in <class:Engine>'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
 /Users/jasonvdm/development/rails/config/environment.rb:5:in `<top (required)>'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
 /Users/jasonvdm/.rvm/gems/ruby-1.9.3-p194@wheelz/gems/activesupport- 3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'

不知道为什么我会收到这些错误。

这就是我的 gemfile,省略了一些私有的结尾部分。

source 'http://rubygems.org'

gem 'rails', '3.1.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'mysql2', '~> 0.3.11'
# gem 'sqlite3'

group :production do
  gem 'thin'
  gem 'pg'
end

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'

# Bundle the extra gems:
 gem 'typus', '~> 3.1.8'
 gem "ckeditor-rails", :git => "https://github.com/fesplugas/rails-ckeditor.git" # for     typus _text_with_ckeditor.html.erb
gem 'nokogiri'
gem 'aws-s3', :require => 'aws/s3'
gem 'aws-sdk'
gem 'paperclip', '~> 2.5.0'
gem 'devise'
gem 'omniauth-facebook'
gem 'cancan'
gem 'koala'
gem 'rc_rails'
gem 'dynamic_form' # to get back old 'error_messages_on' behavior
gem 'role_model'
gem 'renum'
gem 'geokit', "1.6.0"
gem 'rails3-settings', '~> 1.0.0', :require => 'settings', :git =>  'git://github.com/jlaxson/rails-settings'
gem 'acts_as_api'
gem 'twilio-ruby'
gem 'xml-simple', :require => 'xmlsimple'
gem 'braintree', '>= 2.15.0'
gem 'carmen'
gem 'state_machine', :git => 'git://github.com/pluginaweek/state_machine.git'

由于隐私,休息是隐藏的

帮助?

4

1 回答 1

2

看起来您在config/initializers/devise.rb(第 66 行)中有错误。在没有看到该代码的情况下,您似乎正在调用 Devise 上的一个方法,该方法在 Devise 2.0confirm_within中被重命名为。allow_unconfirmed_access_for

https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0

于 2012-06-21T17:56:08.710 回答