Ruby on rails error rake db:migrate -
whenever run rake db:migrate rails_env=development
returns syntax error
rake aborted! syntaxerror: /users/isaiahxd/.rvm/gems/ruby- 2.2.1@rails3tutorial/rails_projects/first_app/db/migrate/20150825050353_create_u sers.rb:21: syntax error, unexpected keyword_end, expecting end-of-input /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activesupport- 4.2.3/lib/active_support/dependencies.rb:274:in `require' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:773:in `load_migration' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:769:in `migration' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:764:in `disable_ddl_transaction' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:1047:in `use_transaction?' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:1039:in `ddl_transaction' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:993:in `execute_migration_in_transaction' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:955:in `block in migrate' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `each' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:951:in `migrate' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:819:in `up' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:797:in `migrate' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/tasks/database_tasks.rb:137:in `migrate' /users/isaiahxd/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
tasks: top => db:migrate (see full trace running task --trace)
i checked , returns
"20150825050353_create_users.rb:21: syntax error, unexpected keyword_end, expecting end-of-input" class createusers < activerecord::migration def create_table :users |t| t.column "first_name", :string, :limit => 25 t.string "last_name", :limit => 50 t.string "email", :default => "", :null => false t.string "password", :limit => 40 t.datetime "created_at" t.datetime "updated_at" t.timestamps null: false end end def down drop_table :users end end
change:
t.timestamps null: false
to:
t.timestamps :null => false
Comments
Post a Comment