Cornelius Wilson
Cornelius Wilson

Reputation: 2924

rake db:migrate gives me rake aborted error

I am following the Lynda ruby on rails tutorial. I am asked to enter "rake db:migrate". However this is the error I received.

lexi87$ rake db:migrate
rake aborted!
/Users/lexi87/Sites/simple_cms/db/migrate/20130107145627_create_users.rb:14: syntax error, unexpected $end, expecting keyword_end
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:537:in `load_migration'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:533:in `migration'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:528:in `migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:777:in `call'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:777:in `ddl_transaction'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:719:in `block in migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:700:in `each'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:700:in `migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:570:in `up'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:551:in `migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/railties/databases.rake:179:in `block (2 levels) in <top (required)>'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I am inside the directory I am supposed to be, which is "sites/simple_cms". I have installed rake and also ran "gem install bundle" and "bundle install". I have done this in the directory, then in the "sites directory" and even the home directory. Nothing makes a difference.

Upvotes: 0

Views: 1407

Answers (2)

Cornelius Wilson
Cornelius Wilson

Reputation: 2924

Sorry I have found out what is wrong. I was missing a second "end" at the bottom of the create users file.

I have been noticing throughout the tutorial that there are lines that I have to add that they don't tell you to. Now I can continue my journey, thanks for the advice guys!

Upvotes: 1

UserROR
UserROR

Reputation: 240

/Users/lexi87/Sites/simple_cms/db/migrate/20130107145627_create_users.rb:14: syntax error, unexpected $end, expecting keyword_end

From the above line of your code "syntax error, unexpected $end, expecting keyword_end ", I think that you have added an extra end in the migration file. Just check if you have extra end or you missed out to put an end in the migration file

Upvotes: 1

Related Questions