0
votes

I have fetched 2 my apps(which have been working in other linux enviornments) from github in newly installed linux. I installed , mysql, nodejs also. I created a test application in rails , and have tested it to be working. But the apps i have cloned, are giving error on running rake db:migrate.

The error in app1:

rake db:migrate == CreateItems: migrating ==================================================== -- create_table(:items) -> 0.0025s == CreateItems: migrated (0.0027s) ===========================================

== AddDataToTableItems: migrating ============================================ rake aborted! An error has occurred, this and all later migrations canceled:

undefined method `manufacturer' for #

The error in app2

rake db:migrate rake aborted! undefined method `[]=' for nil:NilClass

(See full trace by running task with --trace)

Though both the errors are different, they should be related(as the apps are working in other enviornments) . I am stuck due to the issue for half a day . Any inputs regarding the same ?

PS:Migration files for the apps are as follows : http://dl.dropbox.com/u/18367173/migrate_app2.tar.gz http://dl.dropbox.com/u/18367173/migrate_app1.tar.gz

1
Can you post the migrations somewhere?Agis

1 Answers

0
votes

I believe you're trying to add something in a manufacturer field before creating that table column.

Ensure that first all the real migrations are run (those modifying the schema) and only after, run the ones where you publish data in your db.

By the way, you shouldn't use migrations to publish sample data in your apps, you should use rake tasks for this or database seeds.