Keep getting stuck on Saving Data 3/7


#1

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.


#2

Hi @rdore,

PendingMigrationError

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.


#3

I tried that but this:


#4

@rdore Does prepending bundle exec to the command work?

$ bundle exec rake db:migrate

#5

No, it says "rake aborted, don't know how to build task 'bd:migrate'"


#6

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


#7

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.


#8

This topic is solved.