i'm working on a Ruby on rails project adopted by another developer. It's deployed on heroku, uses heroku postgreSQL.
When i run the project on my local rails server with the remote database, it works fine. But there is one problem: I would like to delete some entries. So I tried to connect via PostgreSQL-Console. But it seems like the PostgrqSQL-Console gives me another version of the database than the one who is used by the app.
For example, the latest user ID in the app is 540 and in the database displayed by the console only 500.
Any idea? Thank you in advance.
Problem is solved. The elastic search index wasn't synchronized. Thank you for your help anyway.
Related
I have a script which sends data from a Windows back end to Heroku. Recently I added four new columns to the object model. For testing each of the properties is updated individually through a cURL request.
On the local rails server (which is identical to the Heroku hosted server) all four new attributes are populated correctly and there are no errors in the logs.
On the Heroku based server when I run the back end script it updates two of the columns but not the other two. In spite of these values not being populated the logs indicate that the process ran successfully with status of 200.
Has anyone experienced something similar to this?
Ok, managed to resolve this issue.
The solution was to run heroku restart. Seemingly since Heroku apps are precompiled the new columns were not being recognised by the app.
Peculiarly, the app should've probably raised an UnknownAttributeError before the fix was applied.
Cheers,
CBusBus.
I've completed the Rails Tutorial. I kept up with every detail until the end of chapter 8. The last four chapters I just copied and pasted without trying to understand much.
The Sample App works perfectly on a Cloud9 local web server, but not on Heroku. Specifically, When I want to sign up a new user, I get the message "We're sorry, but something went wrong."
Why can I sign up a new user without problems on the local server but not on Heroku? Is the functionality of the final sample app supposed to be exactly the same on both local and heroku?
You are getting a 500, look at the server logs for a clue. Probably need to run migrations.
Run your migrations:
heroku run rake:db migrate
You may need to restart heroku:
heroku restart
If it still doesn't work, try resetting your database. If you're using postgres, try:
heroku pg:reset DATABASE
I completed every step in the entire Rails Tutorial book, except one, which I thought was optional and wouldn't affect the result in production.
10.3 Email in Production shows you how to configure your application to send emails in production (for account activation in the book's sample application) using a Heroku add-on called Sendgrid.
You do have to give Heroku credit card information (though for the purposes of the book you don't have to actually make any purchase or subscription), and this is why I initially didn't implement this section of the book.
After following along and implementing section 10.3 my final application is fully functional in production.
I am trying to deploy an ecomm site I am developing to Heroku.
I am using Rails 4, Spree 2.1 with the Spree_Fancy theme overtop that, S3 for images, and postgres as database in all environments.
The application is working perfectly on my local machine, but when I deployed it to Heroku, the front end breaks. The app runs via Heroku, but there is no styling at all, no theme, nothing. Just plain text and "no products found" message.
I expected there to be no images (since none had yet been uploaded to s3), but there were no products either, even though the db migrations ran.
Any ideas of what I am missing?
I've just answered on another thread the same problem scenario. Hope it helps.
Broken spree_fancy layout on heroku
I followed this tutorial to make a simple website where you can enter blog entries. I was able to get it working with a postgresql database on my computer.
Then I pushed it to heroku. It was accepted and everything seemed fine.
When I tried to go to the page in my browser though, it didn't work right. You can see it here.
I even tried setting up a shared postgresql database on Heroku. Am I supposed to make some changes to database.yml to get it to work?
One thing I noticed though is that what I added in the shared postgresql database, the error messages seem to indicate that it does find a database, but doesn't find the table. Am I right? I tried to manually recreate the table using the heroku console, but wasn't able to.
What's going on here? How can I get this to work?
Have you tried heroku run rake db:migrate yet?
If that doesn't fix it what does heroku logs --tail tell you?
I'm very new to rails and have been trying to experiment with using Mongodb on a web app.
I have been following this railscast tutorial here word for word and have been running into issues with it not connecting to my local Mongodb.
I'm sure Mongodb is up and running since mongod shows up in my activity monitor and going to
http://localhost:28017/
shows:
http://imgur.com/KJ0JI.png
The problem is when I go to 0.0.0.0:3000/projects/new and try to add a new project name,
this comes up:
http://imgur.com/yxRwC.png
Here is my output when running script/server:
http://imgur.com/A9JTE.png
On my other apps, I have been using sqlite and haven't been having any issues.
I tried uninstalling mongodb and running it anyways for testing purposes and I get
the exact some issue. I guess Mongodb simply isn't being detected through rails and MongoMapper.
Anyone have any idea how to fix this thing?
I spent many hours trying to fix this and resorted to getting a stackoverflow account
and asking on here.
Let me know if there's anything else anyone needs to possibly help diagnose the problem.
Any help would be appreciated.
note: sorry, since I'm new, I can't post pictures of the errors.
I hope you can take the time to view them on imgur