NOT able to rake db:migrate
You called:
\Users\MEGHA\sagar_blog>rails generate scaffold post title:string \ body:text
remove the excess \
:
\Users\MEGHA\sagar_blog>rails generate scaffold post title:string body:text
\
is actually a hard blank, which causes the body
field to be called body
(with a blank before the name), this causes the migration file to generate a line t.text : body
instead of t.text :body
, which fails the migration (and probably later will fail other stuff as well).
Stuck in rake migration
I cloned your repo and it appears the problem is resulting because your User table already has columns for email and name.
In your db/schema.rb file, you can see the db schema is timestamped (:version => 20130627224008) which is earlier than the 2 pending migration timestamps. The schema.rb timestamp will update if/when the migrations are successful.
The point is that it appears you already have columns for email and name in the User table. Specifically look at lines #35 and #47 in your schema.rb.
The error thrown in the development environment that I saw when running rake:db migrate was, "SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email".
I didn't try to push your app to production, but in my experience PostgreSQL (PG) and SQLite errors can be slightly different for the same issue.
rails rake db:migrate migration partially done and need to be redone from scratch
You can reset database back to the original state using the following command and run the migration again.
rake db:reset
Related Topics
No Route Found in Rspec Test for an Existing Route
Why Use Gems for Serving Assets Instead of the Vendor File
Ruby Devise, Sessionscontroller.Create, JSON - Getting Nameerror: Undefined 'Build_Resource'
Pageobject with Ruby - Set Text in a Text Field Only Works in the Main File
How to Use Link_To with Ajax in Rails 3.2.1
Rails Cors Issue with Ajax API Endpoint Request
Compass CSS Framework - Using Bootstrap with SASS
How to Convert Timestamp with Ruby
Receving the Undefined Method 'Generators' Error
How to Send Notifications to the User Whose Post Received a Comment
Ruby String Prepend '\' Character
Adding to the Value in a Hash Table
Zsh Complains About Rvm _Rvm_Cleanse_Variables: Function Definition File Not Found
Ruby on Rails CSV Upload&Import - File Name Too Long
How to Translate Arabic/Persian Numbers to English Using Ruby