Rails应用程序 - 脚手架错误

时间:2014-01-30 19:05:55

标签: ruby-on-rails ruby ruby-on-rails-3 activerecord

我在命令行中执行scaffold命令时遇到rails应用程序问题。我使用了我们老师今天向我们展示的rails generate scaffold User name:string email:string命令。他的工作,但我的得到了以下。

c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `migration_error=' for ActiveRecord::Base:Class (NoMethodError)
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:66:in `block (3 levels) in <class:Railtie>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:65:in `each'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:65:in `block (2 levels) in <class:Railtie>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'

还有更多行,但我希望你明白这一点。如果我需要发布其余的,我会的。除此之外,如果有另一个问题可以解决这个问题,请指出我的方向。提前谢谢。

1 个答案:

答案 0 :(得分:0)

首先尝试通过运行此命令来设置数据库

rake db:drop db:create db:migrate  

rake db:reset