dimanche 30 août 2015

Ruby on rails error rake db:migrate

Whenever I run rake db:migrate RAILS_ENV=development it returns with a syntax error

rake aborted! SyntaxError: /Users/IsaiahxD/.rvm/gems/ruby-2.2.1@rails3tutorial/rails_projects/first_app/db/migrate/20150825050353_create_users.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:inblock 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:inrequire' /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:inmigration' /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:inuse_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:inexecute_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:ineach' /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:inup' /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:inmigrate' /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 ' Tasks: TOP => db:migrate (See full trace by running task with --trace)

I checked everything in create_user.rb and cannot seem to find the problem.

class CreateUsers < ActiveRecord::Migration

def up

create_table :users do |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

Aucun commentaire:

Enregistrer un commentaire