Exercise 4.View Error Message


#1

This is the error I keep receiving over and over

Oops! The test returned an error. Maybe you have a syntax error, or a typo. Hide error.
/var/lib/gems/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:389:in `check_pending!': (ActiveRecord::PendingMigrationError)

I tried running rake db:migrate but the error stays the same.


#2

What message do you get when you try to migrate?


#3

Hey TJ,

Could you give a screenshot of what you see after running rake db:migrate?


@cadecodes

Oops! The test returned an error. Maybe you have a syntax error, or a typo. Hide error.
/var/lib/gems/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:389:in
`check_pending!': (ActiveRecord::PendingMigrationError)


#4

I believe that that is the error when he tries to confirm his answer.

Most of the time (on this course) a migration needs to be forced in order to run.

I can't seem to replicate it at the moment, but it says something like.


#5

@cadecodes That's weird, I don't think I've ever gotten that message on CC.


#6

@zystvan
Just posted picture, this has happened almost every time to me, and I consulted Stack Overflow and saw that I needed to force a migration.

I'll post a Stack link when I find it.


#7


#9

@t.jaey Thanks for the screenshot :slightly_smiling:
Could you try running bundle exec rake db:migrate instead, like it suggests?


#10

ran bundle exec rake db:migrate and got this

ran and completed bundle install and tried bundle exec rake db:migrate again and got this


#11

OK good, we're making progress :slightly_smiling:
Could you show us the entire contents of your routes.rb file, please?


#12

Rails.application.routes.draw do
  get '/messages'=>'messages#index'
  get 'messages/new'=>'messages#new'
  post 'messages' => 'messages#create'
end

  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".

  # You can have the root of your site routed with "root"
  # root 'welcome#index'

  # Example of regular route:
  #   get 'products/:id' => 'catalog#view'

  # Example of named route that can be invoked with purchase_url(id: product.id)
  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

  # Example resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Example resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Example resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Example resource route with more complex sub-resources:
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', on: :collection
  #     end
  #   end

  # Example resource route with concerns:
  #   concern :toggleable do
  #     post 'toggle'
  #   end
  #   resources :posts, concerns: :toggleable
  #   resources :photos, concerns: :toggleable

  # Example resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end
end

...is it possibly that this file seems to have an extra "end"??


#13

@t.jaey You need to remove the end on line 5, and then it should work :slightly_smiling: