saasbook / rottenpotatoes-rails-intro

RottenPotatoes app skeleton for saasbook/hw-rails-intro
33 stars 3.51k forks source link

Page initially opens to Welcome aboard page instead of index page #15

Closed rosewcs345 closed 4 years ago

rosewcs345 commented 7 years ago

When I fork this repo, clone it to my c9 ide, and do the following:

I expect the page to open on the index page, but it opens on the Welcome aboard page instead.

The output from the server indicates that it can't find a route that matches [GET] "/assets/rails.png" (???)

Started GET "/assets/rails.png" for 71.188.237.7 at 2017-03-19 00:57:02 +0000
Cannot render console from 71.188.237.7! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
  ActiveRecord::SchemaMigration Load (0.1ms)  SELECT "schema_migrations".* FROM "schema_migrations"

ActionController::RoutingError (No route matches [GET] "/assets/rails.png"):
  actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  web-console (2.3.0) lib/web_console/middleware.rb:20:in `block in call'
  web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
  web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.6) lib/rails/engine.rb:518:in `call'
  railties (4.2.6) lib/rails/application.rb:165:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  rack (1.6.4) lib/rack/content_length.rb:15:in `call'
  rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
  /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
  /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
  /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'

  Rendered /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (1.3ms)
  Rendered /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (4.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (10.2ms)
  Rendered /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (49.4ms)

In order to get to the movies page, I must first refresh the page, and then I am at root:

Started GET "/" for 71.188.237.7 at 2017-03-19 01:13:07 +0000
Cannot render console from 71.188.237.7! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by MoviesController#index as HTML
  Movie Load (0.3ms)  SELECT "movies".* FROM "movies"
  Rendered movies/index.html.haml within layouts/application (22.6ms)
Completed 200 OK in 228ms (Views: 211.2ms | ActiveRecord: 0.7ms)

Question: Why am I getting a RoutingError initially? Could this possibly be some kind of c9 artifact??

The application behaves (mostly) properly after this point, but I don't understand why it starts up in this strange initial state with an error msg.

I checked, and routes.rb is being rooted properly, so it should start on the correct page.

tansaku commented 7 years ago

weird - just re-ran all of this, and I never saw the welcome page ... and I didn't get those errors - maybe the rottenpotatoes repo has been updated ...