代码之家  ›  专栏  ›  技术社区  ›  Neil Middleton

Rails—部署中的失败路由

  •  5
  • Neil Middleton  · 技术社区  · 15 年前

    我有一个应用程序在routes文件中包含以下内容:

      namespace "admin" do 
        # ADMINISTRATIVE ROUTES ONLY 
        root :to => 'home#index' 
        resources :comments do 
          member do 
            get :approve 
            get :reject 
          end 
        end 
        resources :users do 
          member do 
            get :block 
            get :unblock 
          end 
        end 
      end 
    

    当浏览到本地的/admin时,我会看到相应的页面。 在heroku版本的同一个URL上,我得到一个404

    ActionController::RoutingError (wrong constant name Admin/ 
    homeController): 
    /disk1/home/slugs/196384_c95a9e3_4463/mnt/.bundle/gems/gems/ 
    activesupport-3.0.0.beta4/lib/active_support/inflector/methods.rb: 
    103:in `const_defined?'
    

    有什么想法吗?

    3 回复  |  直到 15 年前
        1
  •  1
  •   Neil Middleton    15 年前

    结果表明,这是一个问题与正确的宝石,我们有在我们的gem文件。

        2
  •  0
  •   Andrew Vit    15 年前

    它看起来像是在寻找一个小写的“homeController”类,但我不明白为什么。检查你的文件以确保你的类命名正确?

        3
  •  0
  •   thomasfedb    15 年前

    看起来像是ActiveSupport测试版中的一个bug。你在跑步吗 相同的rails版本?