I use the following steps to create a model and migrate. However when
it comes running ‘rake db:migrate’ it gave me the following errors. I
suspect it is due to the fact that I was trying to put everything
about blog in its own folder. Is this possible with migration or is
there a different way of putting topics into their own folder. Here
are the steps that I did.
- ruby script/generate model ‘blog/post’
- rake db:migrate
It tried to create a constant ‘CreateBlogPosts’ which I don’t think
its suppose to. Anyone who can help or suggest
something would be greatly appreciated. If I can’t do it this way
I’ll go back to using ‘script/generate model Post’.
Thanks in advance
The error it threw are:
(in /home/naruto/sites/geneva)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
uninitialized constant CreateBlogPosts
/home/naruto/sites/geneva/vendor/rails/activerecord/lib/…/…/
activesupport/lib/active_support/dependencies.rb:266:in
load_missing_constant' /home/naruto/sites/geneva/vendor/rails/activerecord/lib/../../ activesupport/lib/active_support/dependencies.rb:452:in
const_missing’
/home/naruto/sites/geneva/vendor/rails/activerecord/lib/…/…/
activesupport/lib/active_support/dependencies.rb:464:in
const_missing' /home/naruto/sites/geneva/vendor/rails/activerecord/lib/../../ activesupport/lib/active_support/inflector.rb:250:in
constantize’
/home/naruto/sites/geneva/vendor/rails/activerecord/lib/…/…/
activesupport/lib/active_support/core_ext/string/inflections.rb:148:in
constantize' /home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/ migration.rb:366:in
migration_class’
/home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/
migration.rb:346:in migration_classes' /home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/ connection_adapters/mysql_adapter.rb:248:in
inject’
/home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/
migration.rb:342:in each' /home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/ migration.rb:342:in
inject’
/home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/
migration.rb:342:in migration_classes' /home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/ migration.rb:330:in
migrate’
/home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/
migration.rb:297:in up' /home/naruto/sites/geneva/vendor/rails/activerecord/lib/active_record/ migration.rb:288:in
migrate’
/home/naruto/sites/geneva/vendor/rails/railties/lib/tasks/
databases.rake:4
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in
synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in
top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in
top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in
top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
standard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in
load’
/usr/bin/rake:16