2013-07-10 85 views
1

我已經建立了一個簡單的在線申請一個Rackspace的雲服務器上,但我發現從PHUSION客運以下錯誤信息:未初始化的常量的ApplicationController(NameError) - 應用程序工作正常,本地

uninitialized constant ApplicationController (NameError) 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:230:in `block in constantize' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `each' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `constantize' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/core_ext/string/inflections.rb:54:in `constantize' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/devise-2.2.4/app/controllers/devise_controller.rb:2:in `<top (required)>' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/devise-2.2.4/app/controllers/devise/confirmations_controller.rb:1:in `<top (required)>' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/engine.rb:438:in `each' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/engine.rb:438:in `block in eager_load!' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/engine.rb:436:in `each' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/engine.rb:436:in `eager_load!' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/application/railties.rb:8:in `each' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/application/railties.rb:8:in `all' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/engine.rb:434:in `eager_load!' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing' 
    /var/www/ideamobb.com/config/environment.rb:5:in `<top (required)>' 
    config.ru:3:in `require' 
    config.ru:3:in `block in <main>' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 
    config.ru:1:in `new' 
    config.ru:1:in `<main>' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.8/helper-scripts/rack-preloader.rb:82:in `eval' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.8/helper-scripts/rack-preloader.rb:82:in `preload_app' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.8/helper-scripts/rack-preloader.rb:127:in `<module:App>' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.8/helper-scripts/rack-preloader.rb:6:in `<module:PhusionPassenger>' 
    /var/www/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.8/helper-scripts/rack-preloader.rb:5:in `<main>' 

我m不知道這裏發生了什麼 - 應用程序在我的本地主機上工作得很好 - 所有的gem都已安裝,遷移被清除 - 那麼究竟是什麼問題呢?

+0

你可以發佈你的config/environment.rb和config/production.rb嗎? –

+0

這裏是鏈接到站點,你可以看到phusion乘客轉儲http://173.203.64.44/ – Ali

+1

你可以嘗試運行'rails server -e production'來查看應用程序是否工作? –

回答

10

我想你是缺少ApplicationController。所有其他控制器從這個類

簡單application_controller.rb

class ApplicationController < ActionController::Base 

end 
+0

包含此文件 - 這是我不明白。它在我的本地主機上正常工作,但它給了我這個錯誤在線:( – Ali

+0

對不起 - 你是對的,該文件包括但由於某種原因filezilla選擇不上傳這個文件。 – Ali

0

在我來說,繼承我在routes文件拼寫錯誤的「應用程序」。一定要檢查你的拼寫!

相關問題