gpt4 book ai didi

ruby-on-rails - 使用 Passenger "the page you were looking for doesn' t exist 部署 Rails”

转载 作者:太空宇宙 更新时间:2023-11-03 16:07:03 25 4
gpt4 key购买 nike

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

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

最佳答案

事实上,在您的 routes.rb 中没有匹配请求路径 /rideboard 的路线。但是,您似乎已将您的应用本地部署到该子路径,因此 http://your.host/rideboard 实际上请求您应用的根路径。

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

关于ruby-on-rails - 使用 Passenger "the page you were looking for doesn' t exist 部署 Rails”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11748993/

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