Error with Rake DB:Migrate undefined method `confi

2019-08-17 10:12发布

问题:

I'm getting this error when I try run 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'

Not sure why i'm getting these errors at all.

This is what it is my gemfile, leaving out some of the end portions that are private.

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'

rest is hidden due to privacy

Help?

回答1:

Looks like you have an error in config/initializers/devise.rb (line 66). Without seeing that code it seems as though you are calling a method on Devise called confirm_within that was renamed to allow_unconfirmed_access_for in Devise 2.0.

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



标签: ruby devise