使用Passenger部署Rails“您正在寻找的页面不存在”

时间:2012-07-31 21:04:56

标签: ruby-on-rails ruby passenger

我正在尝试使用Passenger部署Rails应用程序。我遵循了这个指南:http://wiki.ocssolutions.com/Deploying_a_Rails_Application_With_Passenger并安装了我的所有宝石,但是当我去应用程序所在的位置时,我看到了

The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.

我意识到这不是很多信息,但我不知道该做什么。我从哪里开始对此进行故障排除?

编辑:这是在日志中

Started GET "/rideboard" for 173.64.211.61 at 2012-07-31 18:31:26 -0400

ActionController::RoutingError (No route matches [GET] "/rideboard"):
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
railties (3.2.3) lib/rails/railtie/configurable.rb:30:in `method_missing'
passenger (3.0.7) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.7) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.7) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:170:in `block in handle_spawn_application'
passenger (3.0.7) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.7) lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.7) helper-scripts/passenger-spawn-server:99:in `<main>'

一个可能的问题是,在开发中我使用Ruby 1.9.3并且在生产中服务器有1.9.2。这会导致它吗?

这是我的routes.rb文件:

Rideboard::Application.routes.draw do
  resources :requests

  get "info/about"

  resources :rides

  get "home/index"

  root :to => "rides#index"
end

1 个答案:

答案 0 :(得分:2)

实际上,routes.rb中没有与请求的路径/rideboard匹配的路由。但是,您似乎已将应用程序本地部署到该子路径,以便http://your.host/rideboard实际请求您的应用程序的根路径。

您可以尝试在服务器上请求应用的实际根路径,即http://your.server/。它可能应该显示您的应用程序的主页。如果您确实希望在/rideboard下部署它,则必须调整部署设置。对于乘客,您必须在关注the documentation of Passenger时使用RackBaseURI