-1

I have been facing this Completed 500 Internal Server Error when developing my Rails application. I am following online tutorials for the development and it works fine previously. However, starting today, it gives me this error if I am trying to render pages other than the normal "Yay, you are on Rails!" page.

  Rendering messages/index.html.erb within layouts/application
  Rendered messages/index.html.erb within layouts/application (Duration: 0.6ms | Allocations: 199)
Completed 500 Internal Server Error in 19ms (ActiveRecord: 0.0ms | Allocations: 6751)

I have properly defined my Routing in config/routes.rb (routing to messages#index), I have defined a proper controller in app/controllers/message_controller.rb and I have defined a proper view for the messages#index, but it still give me this error all the time.

The log only contains the above snippet and whenI inspect from the Web, there doesnt seem to have any useful information for me to debug.

Any help is appreciated, thank you!

Alice
  • 11
  • 1
  • 4
  • do you have an action with the same name? You should provide what your routes looks like as well as your view and your controller. The go rails should happen automatically. If Go rails renders....then the server is working you just need to configure your settings right. Also version of rails and ruby will always help. – Thomas Apr 18 '20 at 16:18
  • what is the error? how can someone help you without see the error? – matanco Apr 18 '20 at 17:11

1 Answers1

0

I have found the problem by doing a 'rails s -e test'! It shows the error message in detail, it said that the table Messages did not exist, though it does.

I solved it then by removing messages.yml inside test/fixtures, from Rails: Old, non-existant database table causes tests to error. Not really sure why it works because of removing this file though, but thank you for the answers!

Alice
  • 11
  • 1
  • 4