Getting an error : ActionController::RoutingError (No route matches [GET] "/tracks") while installing TracksApp

Getting an error : ActionController::RoutingError (No route matches [GET] "/tracks") while installing TracksApp

我正在尝试在 Nginx + Passenger 上安装 Tracks,但在尝试访问该站点时遇到以下错误: The page you were looking for doesn't exist. 当我检查 /log/production.log 时,我看到以下记录:

ActionController::RoutingError (No route matches [GET] "/tracks"):
  actionpack (4.1.11) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.1.11) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.11) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.11) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.11) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.11) lib/active_support/tagged_logging.rb:26:in `tagged'

我怀疑我试图在我的域中使用子 uri 的问题,即 www.example.com/tracks,例如在 Redmine 中,我需要在 environment.rb 中添加以下行:

RedmineApp::Application.routes.default_scope = { :path => '/redmine', :shallow_path => '/redmine' }
...
Redmine::Utils::relative_url_root = "/redmine"

也许我需要在 Tracks 中进行相同的更改,但我不知道 rails。

这是来自 nginx.conf 的配置,负责此曲目:

location /tracks {
           passenger_enabled on;
           alias   /opt/tracks/public;
           index  index.html index.htm;
       }

提前致谢。

好的,感谢我的朋友,他向我介绍了本教程:https://www.phusionpassenger.com/library/deploy/nginx/deploy/ruby/#deploying-an-app-to-a-sub-uri 随后我在 nginx.conf 部分 location /tracks 中更改为以下内容:

location /tracks {
          passenger_base_uri /tracks;
          passenger_app_root /opt/tracks;
          passenger_document_root /opt/tracks/public;
          passenger_enabled on;
          alias   /opt/tracks/public;
          index  index.html index.htm;
      }

问题解决了。