我的问题是,为什么我必须看到这个错误?
main:Object 的未定义方法“root”
当我访问我的网站并查看 Phusion 错误页面时,我得到了这个。这是长输出:
无法启动 Ruby on Rails 应用程序 可能的原因如下: 应用程序代码中可能存在语法错误。请检查此类错误并修复它们。可能未安装所需的库。请安装此应用程序所需的所有库。应用程序可能未正确配置。请检查所有配置文件是否正确写入,修复任何不正确的配置,然后重新启动该应用程序。应用程序依赖的服务(例如数据库服务器或 Ferret 搜索引擎服务器)可能尚未启动。请启动该服务。有关错误的更多信息可能已写入应用程序的日志文件。请检查它以便分析问题。错误消息:main:Object 异常类的未定义方法“root”:
文件行位置 0 /home/$user/rails_apps/$app/config/routes.rb 34
1 /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 227 在
draw' 2 /home/$user/rails_apps/$app/config/routes.rb 1 3 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb 173 in
load_without_new_constant_marking' 4 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3 .14/lib/active_support/dependencies.rb 173 在load' 5 /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 287 in
load_routes!6 /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 287 ineach' 7 /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 287 in
load_routes!8 /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb 267 inreload!' 9 /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb 537 in
initialize_routing' 10 /usr/lib/ruby/gems/1.8/gems/rails-2.3 .14/lib/initializer.rb 188 在process' 11 /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb 113 in
发送'12 /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb 113 在run' 13 /home/$user/rails_apps/$app/config/environment.rb 9 14 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb 36 in
gem_original_require' 15 /usr/lib/ruby/site_ruby /1.8/rubygems/custom_require.rb 36 英寸require' 16 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb 222 in
preload_application' 17 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb 181 ininitialize_server' 18 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/utils.rb 572 in
report_app_init_status' 19 /usr/lib/ruby/gems/1.8/gems/passenger -3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb 174 在initialize_server' 20 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 204 in
start_synchronously' 21 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 180 在start' 22 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/classic_rails/application_spawner.rb 149 in
start' 23 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 219 在spawn_rails_application' 24 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 132 in
lookup_or_add' 25 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/ lib/phusion_passenger/spawn_manager.rb 214 在spawn_rails_application' 26 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 82 in
同步'27 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 79synchronize' 28 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 213 in
spawn_rails_application' 29 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 132 inspawn_application' 30 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 275 in
handle_spawn_application' 31 /usr/lib/ruby/gems/1.8/gems/passenger-3.0 .12/lib/phusion_passenger/abstract_server.rb 357 在__send__' 32 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 357 in
server_main_loop' 33 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 206 在 `start_synchronously' 34 /usr/ lib/ruby/gems/1.8/gems/passenger-3.0.12/helper-scripts/passenger-spawn-server 99
这里的规格是:
宝石列表--本地导轨
*** 当地宝石 ***
导轨 (2.3.14)
ruby -v && gem -v ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux] 1.8.23
在我的 config/environment.rb 我指定 rails 2.3.14
另外,我正在使用 cPanel 但不使用 cPanel 帐户来查看和处理此应用程序。