Keep getting stuck on Saving Data 3/7

The instructions are: In the routes file, create a route that maps the URL /messages to the Messages controller’s index action.

This is the code that codecadamy gave me because I had done it wrong so many times:

Rails.application.routes.draw do

get '/messages' => 'messages#index'

I keep getting this error: /var/lib/gems/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:389:in `check_pending!’: (ActiveRecord::PendingMigrationError)

Not sure what to do. Thanks for the help.

Hi @rdore,


What does that remind you of that you’ve done earlier in the course?

Answer (click to view)

You need to run rake db:migrate in the terminal to migrate the database.

I tried that but this:

@rdore Does prepending bundle exec to the command work?

$ bundle exec rake db:migrate

No, it says “rake aborted, don’t know how to build task ‘bd:migrate’”

@rdore You typed bundle exec rake bd:migrate wrong, it should be bundle exec rake db:migrate (you accidentally reversed the d and b)

Thanks! After typing it right it let me know that for some reason the bundle install didn’t work the first time so that was throwing everything off. It’s working now.

1 Like

This topic is solved.