Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdam Carter
3,108 PointsWeird error after pushing to Heroku, newbie here...
Hi all! I've been doing the Rails tutorial, the Treebook app. I got it working on my localhost:3000, I registered a couple users and added friends and everything works fine. Followed all the steps, pushed to heroku.
On heroku, whenever you click to add someone as a friend, it says "We're sorry, but something went wrong.".....yet it works fine when I run it locally! It is so frustrating, after spending hours following along with the videos...I've googled and googled, tried all kinds of things...the heroku run rake db:setup command in terminal, I've done git add . and git commit, etc...really confused, any help would be appreciated!
Here is the heroku link, also: http://myfriends1.herokuapp.com/
4 Answers
Kenan Memis
47,314 PointsHi,
Did you try to run heroku logs in order to see the error when clicked on "Add Friend" button?
It may give a clue about the problem, since without seeing logs or having no access to the code can not say much. On the other hand when you have everything fine on development while having errors on production, it is most probably either from a production config (including db config) or assets..
You can run heroku logs by
heroku logs --tail
Stone Preston
42,016 Pointsif it works fine locally but not on heroku it may have something to do with postgres. Just a thought.
Tyler Oliver
8,306 PointsTry running $ run rake heroku db:migrate. I belive that's the command though I may be wrong. Basically you have to create and migrate your heroku db
Adam Carter
3,108 Pointsunfortunately that doesn't work :(
Tyler Oliver
8,306 Pointshttps://devcenter.heroku.com/articles/rake and dont forget to restart the heroku db after wards. your problem always happens to me when i deploy online
Adam Carter
3,108 PointsAdam Carter
3,108 Pointsawesome thanks, I will try that now and see if I can find the error!