2

I've just started the Ruby on Rails tutorial written by M. Hartl. . I've followed every step from 2.1 to 2.1.1 . So i've created the app and pushed all the changes I made to Heroku

with $ heroku create and $ git push heroku master

didn't get any errors or anything. but when i tried to view the app by clicking on the address (https://pacific-woodland-39108.herokuapp.com) i could only see "The page you were looking for doesn't exist. ". So something went wrong but i can't find what. I've been looking at similar problems for the past 3hours and tried numerous "solutions" but nothing worked. I even deleted the app and did every step that the tutorial states again. But it didn't help.

Is there somebody that can help me out?

EDIT:

I've apparently played to much with the 'heroku create' command and now i have several apps. Maybe i should delete all of them (how?) and start from scratch?

The route is is adjusted ( removed the' # ' in order to activate )

commands i used that were mentioned in one of the answers. Still doesn't work though :/

    source 'https://rubygems.org'


source 'https://rubygems.org'

GEMFILE:

  gem 'rails', '4.2.2'
  gem 'sass-rails', '~> 5.0'  
  gem 'uglifier', '>= 1.3.0'

  gem 'coffee-rails', '~> 4.1.0'
  gem 'jquery-rails'
  gem 'turbolinks'
  gem 'jbuilder', '~> 2.0'
  gem 'sdoc', '~> 0.4.0', group: :doc


 group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'sqlite3', '1.3.9'
end

group :production do
 gem 'pg', '0.17.1'
 gem 'rails_12factor', '0.0.2'
end

ROUTE file:

Rails.application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

# You can have the root of your site routed with "root"
root 'welcome#index'
  • Did you add any route/controller/view besides the default generated app? – Simone Carletti May 11 '16 at 14:41
  • 1
    Possible duplicate of [Heroku Rails Setup "The page you were looking for doesn't exist."](http://stackoverflow.com/questions/22026492/heroku-rails-setup-the-page-you-were-looking-for-doesnt-exist) – Pholochtairze May 11 '16 at 14:48
  • If you run `heroku logs` do you see the 500 error? – NM Pennypacker May 11 '16 at 15:11
  • I ran into many problems with tutorial but it was always my own mistakes. The tutorial works. Start that section from beginning again. – Timmy Von Heiss May 11 '16 at 15:35
  • please include your route file and gemfile. – Shyam Bhimani May 12 '16 at 02:31
  • route file and gemfile have been included. (still figuring out how stackoverflow works ) – julienverheughe May 12 '16 at 14:41
  • your routes.rb file does not match the tutorial's routes.rb I would suggest you to follow the chapter 2 from start to the end and you can follow my answer below at the last to deploy your app on heroku. https://github.com/shyambhimani/ShyamBhimani_RailsTutorial_CH2_Toy_App for your reference – Shyam Bhimani May 13 '16 at 07:20
  • I've made the adjustments you told me to but when i try '$ git heroku push master' I receive this error "Push rejected, failed to detect set buildpack Heroku/ruby" (thanks for helping btw, it's a mess :/) – julienverheughe May 13 '16 at 09:54
  • EUREKA! i solved the issue. First of all thanks for all the answers, there were apperently a number of issues. But after i was sure that the gemfiel and route.be file were ok it still wouldn't push. Eventually i used the '$ heroku git:remote ' command and after that everything went smoothly! – julienverheughe May 13 '16 at 11:23

4 Answers4

0

Things to double check:

  • Make sure you have set a root in your routes.rb file
  • Don't forget to migrate with heroku run rake db:migrate
0

You can delete heroku app by following command

$heroku apps:destroy –app appname

Or

You can log in to heroku and you will see all the app you created click on app you want to delete then click on settings then go at bottom of the page and you will see delete app option click on it and follow instruction.

I would suggest you to delete existing app. Follow below command to make new heroku app. (you can deploy your rails app after you done with all the exercise in particular chapter.)

$ git init

$ git add .

$ heroku create

$ git commit -am "Initialize repository" 

$ git push heroku master

$ bundle exec rake db:migrate

$ heroku run rake db:schema:load

This will work. good luck

Shyam Bhimani
  • 1,310
  • 1
  • 22
  • 37
0

EUREKA! i solved the issue. First of all thanks for all the answers, there were apperently a number of issues. But after i was sure that the gemfiel and route.be file were ok it still wouldn't push. Eventually i used the '$ heroku git:remote ' command and after that everything went smoothly!

-1
$heroku create
$git add -A
$git commit -m "message"
$git push heroku master
$heroku run rake db:migrate
$heroku open

And make sure you have on routes.rb a route for root Enjoy

Boltz0r
  • 970
  • 5
  • 16