I am following Michael Hartl's Rails Tutorials screen cast series and having trouble in deploying demo Rails application in Heroku. The deploy is successful but when I try to open the URl, it gives an Application Error
The link for the app is http://evening-lake-3818.herokuapp.com/ . Please Help !!
Looks like you've not used rake db:migrate
Heroku
This error is a heroku error (not a rails problem) - the typical Rails errors are the red error page, which says something like "Something went wrong" or "Page Cannot Be Found":
The error you are seeing is a Heroku problem, and is typically because you've either not set up your production database, or you have not got the required migrations to make it work.
The way to fix this is to run:
# heroku run rake db:migrate
Other than that, you'll also need to ensure you have the config/database.yml set up correctly for your production environment (which I can help you with if you need it)
Related
My app works perfectly on my development server, but after I deploy to Heroku, I cannot logout.
When I click on the log out button, it should redirect me to my root, which it does in development.
However, after I deploy on Heroku, it tries to direct me to "/logout" and fails. I do not get logged out. Please help.
I am new to this, so I am not sure what you need to see.
You need to migrate production database with heroku, for that:
$heroku run rake db:migrate
I'm cloning a RoR app from Github. After the clone I install my gems. Now at this point my question/problem arises. Some research I've done suggests I do a
rake db:create
followed by a
rake db:migrate
I've tried both of those steps but am still having trouble.
When I run
rails console
and do something like Plan.first it returns nil. And when I try to visit my application I get an ActiveRecord::RecordNotFound in PagesController#home error alluding to the fact that it can't find the plan id of 1.
Any help is much appreciated.
Thanks in advance!
You have an empty database with no data in it, if seeds are provided - rake db:seed will help, otherwise you'll have to create initial data youself (in rails console, or may be directly in db)
I'm a newbie developing a rails app. I pushed the master to Heroku and ran "git heroku run rake db:migrate" without problems.
The app runs great locally, but on Heroku a "duration" field in one of my tables erroneously reports an error indicating that it "can not be blank" even though I pass it a valid value per the model's validation. This behavior only occurs on Heroku. Locally, the "presence" validation behaves as expected. Heroku does not indicate any problen with my database schema, but it appears something may be wrong in the database. That's my hunch, but I don't know.
To troubleshoot: I reset the Heroku database by running "heroku pg:reset DATABASE" and then ran "heruko run rake db:migrate". Those commands did not solve the problem.
I don't know how to troubleshoot further. Any thoughts, suggestions or ideas? I'm running SQLite3 in my development & testing environments with pg on Heroku. I haven't made any unusual SQLite migrations. I do plan to get rid of SQLite3 and go with pg entirely, but I need to solve this problem first. Thanks in advance for any help!
I'm using railshoster.de and they don't help me deploying my app.
It is this one: https://github.com/ClaudiuCreanga/your-priorities
It works in localhost.
Railshohster.de is using capistrano and passanger.
I get this error when trying to run it: We're sorry, but something went wrong.
In development.log there is no error.
What did I do:
1) Cloned my app
2) bundle install - worked well
3) rake db:schema:load and rake db:seed also worked well.
My questions are:
Where else can I look for errors?
Should it be any difference in deploying localhost vs online?
Thanks!
Finally the issue was with the table migration not being done properly and failing at some point.
I am configuring heroku_san for deploying Rails to Heroku. When I run any rake task it creates, I keep getting this error:
rake production deploy
No heroku apps are configured. Run:
rails generate heroku:config
I know that there are Heroku apps because I can see them when I run heroku list. What might be happening? Why can't this gem find the Heroku apps?
It looks like the gem was looking for a file called ~/.heroku/credentials. I did not have it. So I created that and added my user email and password separated by a linebreak:
myemail#gmail.com
herokupassword
Worked like a charm.