Rails应用 - 脚手架错误 [英] Rails Apps - scaffold error

查看:115
本文介绍了Rails应用 - 脚手架错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的命令行执行脚手架命令时,有一个Rails应用程序的问题。我使用了轨生成脚手架用户名:字符串电子邮件:字符串命令,我们的老师今天给我们。他的工作,但我得到以下几点。

<$p$p><$c$c>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的':未定义的方法`migration_error ='为的ActiveRecord :: Base的:类(NoMethodError)     从c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:66:in `块(3级)与&lt;类:Railtie&GT;     从c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:65:in `每个     从c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:65:in `块(2级)与&lt;类:Railtie&GT;     从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的'

有更多的线路,但我希望你的想法。如果我需要后剩下的,我会的。除此之外,如果有,有这个问题的答案另一个问题,请点我在那个方向。谢谢你在前进。

解决方案

尝试建立数据库首先运行此命令

 耙分贝:滴分贝:创建DB:迁移
 

 耙分贝:重设
 

I'm having a rails app problem when executing the scaffold command in my command line. I used the rails generate scaffold User name:string email:string command that our teacher showed us today. His worked, but mine gets the following.

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'

There are more lines, but I would hope that you get the idea. If I need to post the rest, I will. Beyond that, if there is another question that has the answer to this, please point me in that direction. Thank you in advance.

解决方案

Try set up your database first by running this command

rake db:drop db:create db:migrate  

or

rake db:reset 

这篇关于Rails应用 - 脚手架错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆