当我尝试运行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'
由于隐私隐藏了休息
帮助?
答案 0 :(得分:2)
您似乎在config/initializers/devise.rb
中遇到错误(第66行)。在没有看到代码的情况下,您似乎在Devise上调用了一个名为confirm_within
的方法,该方法在Devise 2.0中被重命名为allow_unconfirmed_access_for
。
https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0