0

I was having issues migrating databases with mysql and decided to blow the whole thing out of the water and use postgres. I have it installed correctly along with the databases but now I'm getting the same errors I along the lines of when I was using mysql.

$ rake db:migrate
rake aborted!
/Users/beach180/rails_projects/app/db/migrate/20120114221528_create_users.rb:6: syntax          error, unexpected ':', expecting keyword_end
  t.string "email" :default => "", :null => false

This is the rb file

class CreateUsers < ActiveRecord::Migration
  def up
    create_table :users do |t|
      t.string "first_name", :limit => 25
      t.string "last_name", :limit => 50
      t.string "email" :default => "", :null => false
      t.string "password", :limit => 40
      t.timestamps
    end
  end

  def down
    drop_table :users
  end
end

Got any ideas?

1 Answer 1

2

You're missing a comma after the string "email".

t.string "email", :default => "", :null => false
                 ^ comma
Sign up to request clarification or add additional context in comments.

1 Comment

yep, that was it. About to create another ticket for a different error. Thx Dave :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.