0
votes

I'm couple weeks into ruby & rails... but I'm an experienced programmer.

I've migrated my POC app to heroku.

The app is there. I see the standard ruby landing page:

http://pacific-lake-7797.herokuapp.com/

When I hit my POC page:

http://pacific-lake-7797.herokuapp.com/user_stories

I get:

The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved.

and i see this in the logs:

←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m Started GET 
"/user_stories" for 66.31.53.52 at 2013-03-13 00:08:00 +0000
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/
active_support/inflector/methods.rb:230:in `block in constantize'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/
active_support/inflector/methods.rb:229:in `each'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m 
ActionController::RoutingError (uninitialized constant UserStoriesController):

It seems pretty obvious to me that the problem is related to this log message:

ActionController::RoutingError (uninitialized constant UserStoriesController):

But so far I've not found anything that explains what that might mean.

Here's what I've tried (thanks in large part to you all!)

DB looks good

I ran rake db:migrate and the logs looked good. I can also access the database from my local postgres admin. The page does not actually hit the database yet, but the DB is there.

config.assets.compile

I changed this setting to true:

config.assets.compile = true

Production runs fine locally

I started the server in production mode with...

rails server -e production

everything works fine.

rake routes

if I run

heroku run "rake routes"

I think I see my route is ok. Warnings seem to be in prep for rails 4.0 which I dont think is used yet.

The results:

$ heroku run "rake routes"
Running `rake routes` attached to terminal... up, run.6943
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support
 for these plugins will be removed in Rails 4.0. Move them out and bundle them i
n your Gemfile, or fold them in to your app as lib/myplugin/* and config/initial
izers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonr
ails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required
)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support
 for these plugins will be removed in Rails 4.0. Move them out and bundle them i
n your Gemfile, or fold them in to your app as lib/myplugin/* and config/initial
izers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonr
ails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required
)> at /app/Rakefile:7)
   user_stories GET    /user_stories(.:format)          user_stories#index
                POST   /user_stories(.:format)          user_stories#create
 new_user_story GET    /user_stories/new(.:format)      user_stories#new
edit_user_story GET    /user_stories/:id/edit(.:format) user_stories#edit
     user_story GET    /user_stories/:id(.:format)      user_stories#show
                PUT    /user_stories/:id(.:format)      user_stories#update
                DELETE /user_stories/:id(.:format)      user_stories#destroy

here's the full log for the record

←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m Started GET "/user_stories" for 66.31.53.52 at 2013-03-13 00:08:00 +0000
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:230:in `block in constantize'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `each'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m ActionController::RoutingError (uninitialized constant UserStoriesController):
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `constantize'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:54:in `controller'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:69:in `controller_reference'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:32:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:601:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/head.rb:14:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/flash.rb:242:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/cookies.rb:341:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:64:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `_run__4347238382960990098__call__3337526573215554696__callba
cks'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m   /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
←[36m2013-03-13T00:08:00+00:00 app[web.1]:←[0m
←[33m2013-03-13T00:08:00+00:00 heroku[router]:←[0m at=info method=GET path=/user_stories host=pacific-lake-7797.herokuapp.com fwd="66.31.53.52" dyno=web.1 queue=0 wait=0ms connect=10ms service=31ms st
atus=404 bytes=728

thanks!

thanks in advance for this... and for the hundreds of other questions you have already answered for me!

1

1 Answers

3
votes

My own fresh eyes found the problem. Nice when the answer comes to you in a dream.

I'm new to GIT too... and made a rookie mistake with it. I must not have added the files to the branch that i was pushing to Heroku (although I really thought I did).

After running:

git checkout master
git add .
commit -am "doh"
git push
git push heroku master

Stuff works!!!

It would have saved me some time if I had pulled down the project from Heroku's git to see what was in it.