是什么导致这些设计错误?
我正在尝试像这样设置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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你使用的是 ruby 1.8.7 & 吗?耙子0.9~?
试试这个:
Are u using ruby 1.8.7 & rake 0.9~?
TRY THIS: