Ruby 在Rails中运行rake命令时的未初始化常量

Ruby 在Rails中运行rake命令时的未初始化常量,ruby,ruby-on-rails-3,rake,Ruby,Ruby On Rails 3,Rake,我正在努力学习本教程。 当我运行rakedb:migrate时,我得到 rake aborted! NameError: uninitialized constant CreateArticles /home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:238:in `const_get' /home/nbandy/.rvm/gems/ruby-

我正在努力学习本教程。 当我运行rakedb:migrate时,我得到

rake aborted!
NameError: uninitialized constant CreateArticles
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:238:in `const_get'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:238:in `block in constantize'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `each'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `inject'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active_support/inflector/methods.rb:236:in `constantize'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:762:in `load_migration'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:757:in `migration'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:752:in `disable_ddl_transaction'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:1045:in `use_transaction?'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:955:in `rescue in block in migrate'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:952:in `block in migrate'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:949:in `each'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:949:in `migrate'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:807:in `up'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:785:in `migrate'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in `eval'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
rake中止!
NameError:未初始化的常量CreateArticles
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active\u support/influctor/methods.rb:238:in'const\u get'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active\u support/influctor/methods.rb:238:in `块在constantize'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active\u support/inchector/methods.rb:236:in'each'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active\u-support/inductor/methods.rb:236:in'inject'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active\u support/inchector/methods.rb:236:in'constantize'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.1.1/lib/active\u support/core\u ext/string/inflexctions.rb:66:in'constantize'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:762:in'load\u migration'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:757:in“migration”
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:752:in'disable\u ddl\u transaction'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:1045:正在“使用”事务中
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active_record/migration.rb:955:在“迁移中的块内救援”中
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:952:在“迁移中的块”中
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:949:in'each'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:949:in“migrate”
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:807:in'up'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/migration.rb:785:in“migrate”
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/gems/activerecord-4.1.1/lib/active\u record/railties/databases.rake:34:in `块(2层)in'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/bin/ruby\u executable\u hooks:15:in'eval'
/home/nbandy/.rvm/gems/ruby-2.0.0-p481/bin/ruby\u可执行文件\u挂钩:15:in`'
任务:TOP=>db:migrate
(通过使用--trace运行任务查看完整跟踪)

在过去的四个小时里,我一直在寻找答案,但没有一个能帮上忙。说到这一点,我是一个绝对的初学者,所以我相信答案比我想象的要明显得多。如果您有任何帮助,我们将不胜感激。

请检查以下文件以及如何命名。公约应当是:

/models/article.rb

class Article < ActiveRecord::Base
...
类文章
/db/migrate/20140625123456_create_articles.rb

class CreateArticles < ActiveRecord::Migration
...
classcreatearticles
有一个步骤要求复制并粘贴到迁移文件中,我在您的帖子中粘贴了文本。谢谢