gpt4 book ai didi

ruby-on-rails - 主要 :Object 的未定义方法 `root'

转载 作者:太空宇宙 更新时间:2023-11-04 11:32:22 25 4
gpt4 key购买 nike

我的问题是,为什么我必须看到这个错误?

undefined method `root' for main:Object

当我访问我的站点并看到错误的 Phusion 页面时,我得到了这个。这是长输出:

Ruby on Rails application could not be started These are the possiblecauses: There may be a syntax error in the application's code. Pleasecheck for such errors and fix them. A required library may notinstalled. Please install all libraries that this applicationrequires. The application may not be properly configured. Please checkwhether all configuration files are written correctly, fix anyincorrect configurations, and restart this application. A service thatthe application relies on (such as the database server or the Ferretsearch engine server) may not have been started. Please start thatservice. Further information about the error may have been written tothe application's log file. Please check it in order to analyse theproblem. Error message: undefined method `root' for main:ObjectException class: NoMethodError Application root:/home/$user/rails_apps/junkie Backtrace:

File Line Location 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 indraw' 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 inload' 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 inprocess' 11 /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb 113 in send'12 /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb 113 inrun' 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 inrequire' 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 in initialize_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 in 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 instart' 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 inspawn_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 inspawn_rails_application' 26 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 82 in synchronize'27 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 79 insynchronize' 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 in__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 in`start_synchronously'34 /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/helper-scripts/passenger-spawn-server 99

这里的规范是:

gem 列表 --local rails

*** 本地 gem ***

rails (2.3.14)

ruby -v && gem -vruby 1.8.7 (2011-02-18 补丁级别 334) [x86_64-linux]1.8.23

在我的 config/environment.rb 中我指定了 rails 2.3.14

此外,我正在使用 cPanel,但没有使用 cPanel 帐户查看和处理此应用。

最佳答案

可能应用希望您在 config/routes.rb 中定义根路由(打开 config/routes.rb 了解详细信息)

关于ruby-on-rails - 主要 :Object 的未定义方法 `root',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10307531/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com