I've spent a solid amount of time on this and I've lost faith in my Heroku abilities.
I have a rails app
I've migrated the database
I've included the rails12_factor gem in production
I have the Heroku toolbelt
I've logged in with my credentials via the terminal
I've created a heroku app with the command "heroku create blahblahblah"
This gave me my remote
I've used 'init' 'add .' 'commit' and everything is up to date
I've deployed with 'git push heroku master'
My app was deployed successfully without any problems
It tells me everything is up to date
My production check says everything passes
I can't for the life of me bloody well figure out why, when I go to my app's URL that it only shows the welcome page "Heroku | Welcome to your new app!"
I'd be forever greatful and in your debt to whomever can help me with this.
In older versions of rails you had to delete the index page from the public directory.
I think in rails 4, you need to define a route for root.
so in your config/routes.rb some thing like :
root to: 'static_pages#home'
Do you have this problem only on Heroku? what happens on localhost:3000?
Related
I'm following this tutorial to a tee and so far so good. I ran into a problem on step 2.6
On my terminal I input
heroku open
After which it opened a new webpage on Chrome.
The terminal then displayed
Opening aqueous-forest-3891... done
The webpage that opened was https://aqueous-forest-3891.herokuapp.com/ and unfortunately it says the webpage may have been moved or does not exist.
I've followed the tutorial exactly (as far as I can tell) and can't figure out what I've done wrong. I'm very new to Rails (and Ruby....and Heroku...).
I'm not exactly sure how to troubleshoot my problem or if there's a command I can use in my terminal for debugging - etc.
Good news: a Rails error means your app is running on the server
Bad news : your routes are likely causing a problem.
According to this blog (which has exactly the same issue), the problem is that Heroku won't host the "default" Rails page. You'll need to create a default page & redeploy:
#config/routes.rb
root "application#index"
#app/views/application/index.html.erb
Hello world
$ git add .
$ git commit -a -m "Default Page"
$ git push heroku master
Context
The error you're seeing is one from Rails:
This is good, as it means your Rails app is actually on the Heroku server & being picked up. This type of error is either suggestive that you have an error with your server (500 error), or a missing page (404 error).
-
If you had the following error, it would be a Heroku (platform) centric issue:
This is normally caused either by a lack of database connectivity, or some sort of environment issue (ENV vars missing etc).
The best way to debug Heroku is to use the Heroku logs.
These are written - as with most event-based software - on the server, allowing you to see what's going on. Heroku recently upgraded their software to include a new real-time logging system:
Checking in there will tell you what's going on, allowing you to take direct action to resolve it.
To debug your issue you will need to view the logs. A quick way is to add the Papertrail add on to your app (there's a free option). Add-ons can be added via the resources tab from Heroku.
Another option is to to view the heroku logs in the terminal with the command
heroku logs -t --app appName
By viewing the logs, you should get some error messages that will help you debug why your app isn't showing.
In my case I deployed custom branch to heroku master, which; heroku usually does not build itself.
If you want to deploy custom branch to heroku use this command.
git push -f heroku your_branch_name:master
I'm reading railstutorial.org Chapter 2 (about toy_app) using cloud IDE and I've run into a problem. I'm newbie so I would appreciate a simple sollution and explanation what I did wrong.
I followed every step as described in tutorial: I created my 'hello world' index page and I pushed it to heroku. I renamed my heroku site as well (it wasn't required in tutorial). Everything was fine at that moment.
I added user and micropost models. I've started a local server (on second terminal by typing rails server -b $IP -p $PORT) and added some users and microposts. Again, everything was working as expected.
I didn't close local server. I committed changes to git and I pushed it to Bitbucket and then to heroku. Finally, I typed heroku run rake db:migrate. It was the final step of this tutorial.
Everything seemed to be Ok, but I noticed that posts and users I added on local server weren't visible on my heroku site. Since I didn't close my local server, I checked it and posts I created were still available. As I said, situation on my heroku site was different.
I didn't get any errors during that process, only one warning after typing git push: Warning: Permanently added the RSA host key for IP address ... to the list of known hosts. Next time it didn't show up.
After my first try of every step I got promising outputs. After second and next tries it returned
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean`
and
Everything up-to-date
So still nothing worrying.
I tried to restart server, to follow those steps again after closing my local server but it didn't help. I searched for solution but only what I found were problems with massive errors or different problems.
Actually, It is problem I can go along with because I don't need it updated at this stage, but I would like to hear an answer and find out if there is something wrong with heroku or it it normal behavior or even if it is newbie's blindness.
First your local database and heroku database are different. Any user created on local app won't be available on heroku app unless you use a common database.
rake db:migrate, in its most basic form, just runs the change or up method for all the migrations that have not yet been run. If there are no such migrations, it exits. It will run these migrations in order based on the date of the migration.
Try creating user and post on heroku app, it should work all fine.
I'm deploying Rails on Heroku for the first time, so I accept I'm a bit of a newbie on this turf.
I installed the tool Heroku tool belt. Created a simple Rails application. Logged into Heroku. did..
heroku Create
And then pushed up the master
git push heroku master
Once the deployment is complete I tried
heroku open
I end up getting a 404. The app though runs fine on my local environment.
Heroku does not provide a standard welcome page for Rails 4. So if you did not create one yourself You will get a 404 page. This problem should not arise if your root to is properly set.
You can test this by creating a home controller with an index action, create the index. html.erb page and define root to: 'home#index'. Now heroku knows about the pageĀ and you will not receive a 404 error.
Getting started with heroku guide: https://devcenter.heroku.com/articles/getting-started-with-rails4
I've succesfully submitted my app to git, and then pushed it to heroku. Starting page working as it has to, but the rest with path heroku_site.com/pages/page_name says me "We're sorry, but something went wrong." Same pages works fine on local server.
Any ideas whats wrong?
inb4 routes are fine(and rest too, rspec spec/ green)
You can view your Heroku logs with $ heroku logs
Looking at your routs, I'd guess that your page is based on content in your local database that you have not added yet to your production database.
If so, you can either push your local database to production $ heroku db:push
Or you can put that data in a Rails migration or seed it. Or you can go create it in your production app.
In general, to find out what you can do: $ heroku help
I'm trying to deploy my rails application with heroku (as shown here). I've created a very simple rails application (using ruby 1.9.2 and rails 3.0.3; i'm sure heroku supports these - see heroku docs), created and pushed github repo, created heroku repo and pushed it (all commiting is done). And when i'm trying to access my application controller, it throws 404 rails page like it's saying 'there is no such controller'. I've done heroku rake db:migrate but first time i ran it i got 'host not found' error. Running this again fixed that. Well, i'm not sure if i should run heroku addons add:postgresql - i though postgres is on by default, but heroku says i should pay in order to get DB (running command i've mentioned asks me to confirm billing it).
May be it sounds stupid, but how can i deploy my rails application (it's a very simple one) without paying any fees and such troubles as 404 pages like i mentioned in the beginning of my post? (and this is my question). Maybe i should choose other hosting (if it exists in our world) or am i doing something wrong with heroku?
You forgot to push your quotes_controller.rb to git and heroku probably.
git add controllers/quotes_controller.rb
it seems you forgot models also, and probably lot of files.