heroku:您要查找的页面不存在(未初始化的常量)

时间:2013-03-13 01:06:38

标签: heroku ruby-on-rails-3.2

我要花几周时间买入红宝石和红宝石。 rails ...但我是一位经验丰富的程序员。

我已将我的POC应用程序迁移到heroku。

该应用程序在那里。我看到了标准的红宝石登陆页面:

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

当我点击我的POC页面时:

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

我明白了:

  

您要查找的页面不存在。

     

您可能输错了地址或页面可能已移动。

我在日志中看到了这一点:

←[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):

对我来说,这个问题与此日志消息有关,这似乎很明显:

ActionController::RoutingError (uninitialized constant UserStoriesController):

但到目前为止,我还没有找到任何可以解释这可能意味着什么的东西。

这是我尝试的内容(非常感谢大家!)

数据库看起来不错

我跑了     rake db:migrate 并且日志看起来很好。我也可以从我当地的postgres管理员访问数据库。该页面实际上还没有到达数据库,但数据库就在那里。

config.assets.compile

我将此设置更改为true:

config.assets.compile = true

本地生产运行良好

我用生产模式启动了服务器......

rails server -e production

一切正常。

佣金路线

如果我跑

heroku run "rake routes"

我想我看到我的路线还行。对于我认为尚未使用的rails 4.0,警告似乎正在准备中。

结果:

$ 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

这是记录的完整日志

←[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

谢谢!

提前感谢...以及您已经为我回答的数百个其他问题!

1 个答案:

答案 0 :(得分:3)

我自己的新眼睛发现了这个问题。很高兴在梦中得到答案。

我也是GIT的新手......并且犯了一个菜鸟错误。我一定不能把文件添加到我推送给Heroku的分支中(尽管我真的以为我做过了。)

跑完后:

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

东西有效!!!

如果我有pulled down the project from Heroku's git来查看其中的内容,那本可以节省一些时间。

相关问题