0

我正在努力解决一个特殊问题,即我的所有 Rails Admin 路由在我的本地服务器上的开发模式下都可以正常工作。但是,只有 1 不适用于生产..

在 Cedar Stack 上使用带有 Thin 的 Rails 3.2.6 - Heroku

我无法加载 1 个称为参考的特定模型的 #index 视图。

但是,我可以加载同一模型的新视图、编辑视图和显示视图。然后再次。所有路由都可以在开发服务器上正常加载。

你们知道我可以从哪里开始吗?

提前非常感谢...

这是我在尝试访问该页面时在 Heroku 日志中遇到的错误。

    3.2.6/lib/active_support/notifications.rb:123:in `block in instrument'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/abstract_controller/rendering.rb:45:in `process'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_controller/metal.rb:203:in `dispatch'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_controller/metal.rb:246:in `block in action'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:73:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:36:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/
lib/rails/railtie/configurable.rb:30:in `method_missing'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:600:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:479:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/sass-3.1.20/lib/sass/plugin/rack.rb:54:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:600:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-pjax-0.5.9/lib/rack/pjax.rb:12:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb:35:in `block in call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb:34:in `catch'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb:34:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/head.rb:14:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/remotipart-1.0.2/lib/remotipart/middleware.rb:30:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/flash.rb:242:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/cookies.rb:338:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/query_cache.rb:64:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/callbacks.rb:405:in `_run__1529569943628666922__call__3530359843174502737__callbacks'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/callbacks.rb:405:in `__run_callback'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/rack/logger.rb:16:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/rack/logger.rb:26:in `call_app'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.6/lib/action_dispatch/middleware/static.rb:62:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/engine.rb:479:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:220:in `call'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:80:in `block in pre_process'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:78:in `catch'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:78:in `pre_process'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:53:in `process'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:38:in `receive_data'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in 
`run'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/backends/base.rb:63:in `start'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:86:in `start'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/server.rb:159:in `start'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
2012-07-18T07:39:00+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
2012-07-18T07:39:00+00:00 app[web.1]: 

我的 rake 路线看起来很正常:

        rails_admin        /admin                         RailsAdmin::Engine
                projects GET    /projects(.:format)            projects#index
                 project GET    /projects/:id(.:format)        projects#show
                 clients GET    /clients(.:format)             clients#index
                  client GET    /clients/:id(.:format)         clients#show
              references GET    /references(.:format)          references#index
               reference GET    /references/:id(.:format)      references#show
        new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
            user_session POST   /users/sign_in(.:format)       devise/sessions#create
    destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
           user_password POST   /users/password(.:format)      devise/passwords#create
       new_user_password GET    /users/password/new(.:format)  devise/passwords#new
      edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                         PUT    /users/password(.:format)      devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
       user_registration POST   /users(.:format)               devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                         PUT    /users(.:format)               devise/registrations#update
                         DELETE /users(.:format)               devise/registrations#destroy
                    root        /                              projects#index
                   about        /about(.:format)               high_voltage/pages#show {:id=>"about_me"}
                    site        /site(.:format)                high_voltage/pages#show {:id=>"site"}
                 contact        /contact(.:format)             contact_us/contacts#new
                    page        /pages/*id                     high_voltage/pages#show
                contacts POST   /contacts(.:format)            contact_us/contacts#create
             new_contact GET    /contacts/new(.:format)        contact_us/contacts#new
              contact_us        /contact_us(.:format)          contact_us/contacts#new

Routes for RailsAdmin::Engine:
    dashboard GET         /                                      rails_admin/main#dashboard
        index GET|POST    /:model_name(.:format)                 rails_admin/main#index
          new GET|POST    /:model_name/new(.:format)             rails_admin/main#new
       export GET|POST    /:model_name/export(.:format)          rails_admin/main#export
  bulk_delete POST|DELETE /:model_name/bulk_delete(.:format)     rails_admin/main#bulk_delete
history_index GET         /:model_name/history(.:format)         rails_admin/main#history_index
  bulk_action POST        /:model_name/bulk_action(.:format)     rails_admin/main#bulk_action
         show GET         /:model_name/:id(.:format)             rails_admin/main#show
         edit GET|PUT     /:model_name/:id/edit(.:format)        rails_admin/main#edit
       delete GET|DELETE  /:model_name/:id/delete(.:format)      rails_admin/main#delete
 history_show GET         /:model_name/:id/history(.:format)     rails_admin/main#history_show
  show_in_app GET         /:model_name/:id/show_in_app(.:format) rails_admin/main#show_in_app

最后,我的 routes.rb 文件:

  Resume::Application.routes.draw do

    mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'

    resources :projects, :only => [:index, :show]

    resources :clients, :only => [:index, :show]

    resources :references, :only => [:index, :show]

    devise_for :users

    root :to => 'projects#index'

    #static pages
    match 'about' => 'high_voltage/pages#show', :id => 'about_me'
    match 'site' => 'high_voltage/pages#show', :id => 'site'

    match 'contact' => 'contact_us/contacts#new'
4

1 回答 1

0

我认为您可能想将references模型重命名为其他名称。我认为这是 Rails 中的一项保留工作,可能会引起一些讨厌的冲突。希望这可以帮助!

于 2012-07-19T08:00:20.467 回答