简体   繁体   中英

Completed 500 Internal Server Error in Rails Development

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!

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM