是什么导致这些设计错误?

发布于 2024-11-30 10:23:06 字数 19066 浏览 0 评论 0原文

我正在尝试像这样设置Devise

$ rails generate devise:install
...
$ rails generate devise User
...
$ rake db:migrate --stack

rake db:migrate --stack 行导致此错误:

WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Elephant::Application#task called at /Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks'
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `devise' for User(Table doesn't exist):Class
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.1/lib/active_record/base.rb:1016:in `method_missing'
/Users/ben/rails_projects/elephant/app/models/user.rb:4:in `<class:User>'
/Users/ben/rails_projects/elephant/app/models/user.rb:1:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:454:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:454:in `block in load_file'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:453:in `load_file'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:340:in `require_or_load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:491:in `load_missing_constant'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:183:in `block in const_missing'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:181:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:181:in `const_missing'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/inflector/methods.rb:124:in `block in constantize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/inflector/methods.rb:123:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/inflector/methods.rb:123:in `constantize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:523:in `block in <class:Reference>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:533:in `yield'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:533:in `default'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:533:in `get'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/mapping.rb:69:in `to'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/mapping.rb:64:in `modules'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/mapping.rb:73:in `strategies'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise.rb:281:in `block in configure_warden!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise.rb:280:in `each_value'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise.rb:280:in `configure_warden!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:7:in `finalize_with_devise!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:128:in `block in reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:128:in `reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:120:in `block in routes_reloader'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/railtie.rb:14:in `block (2 levels) in <class:Railtie>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `new'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `inject'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:162:in `app'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
/Users/ben/rails_projects/elephant/config/environment.rb:5:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:103:in `require_environment!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:216:in `block in initialize_tasks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment

user.rb 如下所示:

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable, :lockable and :timeoutable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me
end

如果我注释掉 devise :database_authenticatable... 行,并运行 rake db:migrate --stack,我明白了此错误:

WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Elephant::Application#task called at /Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks'
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application definition in 'config/application.rb'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:245:in `raise_no_devise_method_error!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:140:in `block in devise_for'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:136:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:136:in `devise_for'
/Users/ben/rails_projects/elephant/config/routes.rb:4:in `block in <top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `draw'
/Users/ben/rails_projects/elephant/config/routes.rb:1:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `block in load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:127:in `block in reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:127:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:127:in `reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:120:in `block in routes_reloader'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/railtie.rb:14:in `block (2 levels) in <class:Railtie>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `new'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `inject'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:162:in `app'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
/Users/ben/rails_projects/elephant/config/environment.rb:5:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:103:in `require_environment!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:216:in `block in initialize_tasks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment

是什么导致了这些错误?

我正在运行 Rails 3.0.1 和 Ruby 1.9.2

I am trying to setup Devise like this:

$ rails generate devise:install
...
$ rails generate devise User
...
$ rake db:migrate --stack

The rake db:migrate --stack line causes this error:

WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Elephant::Application#task called at /Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks'
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `devise' for User(Table doesn't exist):Class
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.1/lib/active_record/base.rb:1016:in `method_missing'
/Users/ben/rails_projects/elephant/app/models/user.rb:4:in `<class:User>'
/Users/ben/rails_projects/elephant/app/models/user.rb:1:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:454:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:454:in `block in load_file'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:453:in `load_file'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:340:in `require_or_load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:491:in `load_missing_constant'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:183:in `block in const_missing'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:181:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:181:in `const_missing'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/inflector/methods.rb:124:in `block in constantize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/inflector/methods.rb:123:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/inflector/methods.rb:123:in `constantize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:523:in `block in <class:Reference>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:533:in `yield'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:533:in `default'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:533:in `get'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/mapping.rb:69:in `to'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/mapping.rb:64:in `modules'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/mapping.rb:73:in `strategies'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise.rb:281:in `block in configure_warden!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise.rb:280:in `each_value'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise.rb:280:in `configure_warden!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:7:in `finalize_with_devise!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:128:in `block in reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:128:in `reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:120:in `block in routes_reloader'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/railtie.rb:14:in `block (2 levels) in <class:Railtie>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `new'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `inject'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:162:in `app'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
/Users/ben/rails_projects/elephant/config/environment.rb:5:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:103:in `require_environment!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:216:in `block in initialize_tasks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment

user.rb looks like this:

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable, :lockable and :timeoutable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me
end

If I comment out the devise :database_authenticatable... line, and run rake db:migrate --stack, I get this error:

WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Elephant::Application#task called at /Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks'
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
User does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application definition in 'config/application.rb'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:245:in `raise_no_devise_method_error!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:140:in `block in devise_for'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:136:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.1.5/lib/devise/rails/routes.rb:136:in `devise_for'
/Users/ben/rails_projects/elephant/config/routes.rb:4:in `block in <top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `draw'
/Users/ben/rails_projects/elephant/config/routes.rb:1:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `block in load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:127:in `block in reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:127:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:127:in `reload_routes!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:120:in `block in routes_reloader'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/railtie.rb:14:in `block (2 levels) in <class:Railtie>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `new'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `inject'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `build'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:162:in `app'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
/Users/ben/rails_projects/elephant/config/environment.rb:5:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:103:in `require_environment!'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/application.rb:216:in `block in initialize_tasks'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load'
/Users/ben/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment

What is causing these errors?

I am running Rails 3.0.1 and Ruby 1.9.2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

背叛残局 2024-12-07 10:23:06

你使用的是 ruby​​ 1.8.7 & 吗?耙子0.9~?

试试这个:

module ::YOUR_APP_NAME
  class Application
      include Rake::DSL
  end
end

Are u using ruby 1.8.7 & rake 0.9~?

TRY THIS:

module ::YOUR_APP_NAME
  class Application
      include Rake::DSL
  end
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文