Help with Heroku, does not it show pages with the Ruby language?

0

Hello, I need the help of the noble knowledge holders. I'm studying Ruby on Rails through the Codecademy website. I got some things I learned there, and I tried to put it online at Heroku. Everything went right at the beginning, everything perfect. But suddenly, when trying to get on a specific page, it showed the following error:

Suchanerrorisnotshowninlocalhost.SoIdecidedtostartfromscratchanddeployeverysteptofindtheproblem.Theproblemwasthatanormalpagewithpurehtmlopensquietly,butonewithRuby(insidethefile)givesthisproblem.

Thefollowingcodeisgeneratingtheproblem(Ibelieve)

<%@messages.eachdo|message|%><divclass="message">
        <p class="content"><%= message.content %></p>
        <p class="time"><%= message.created_at %></p>
      </div>
<% end %>

The link in case you want to check in personally is this:

link


There are 2 buttons, the "Messages!" Button. has the above excerpt in the code and shows the error. And the Test button has no and does not show error.


Would anyone like to spend some time to help me? It will be of great help. Thank you.

Update:
HomeThisisthecontrollerfortheproblempage.
Archiveinsidedb/migrate:

Log in:

    
asked by anonymous 10.12.2017 / 06:10

1 answer

0

Personal to see now, I have been able to solve the problem

The problem was the database. There was no code table in the Heroku database, because I had not migrated it! How stupid of me. That's why it worked on localhost. Home What I did was the second:

- I looked at the Logs, a thank you to wmsouza (I do not know how to dial, anyway) by reminding me that they exist. - In the logs he said he could not connect to the table "messages" in the database. Obvious right. I HAD NOT MIGRATED HER PRO HEROKU DATA BANK, SHE WAS ONLY ON MY PC why it did not work.

- I found after much searching, the link page that has the data needed to make the connection. Home - I took this data and put it in the database.yml file. - I also connected my pgAdmin3 with this data. Home - I gave a rake db: migrate and a rake db: seed . And then, solved the problem, the page normally opens now, and shows the messages that are on the server.

That's all.

Well, guys, I'm motivated to learn Ruby on Rails again.

    
12.12.2017 / 04:00