没有路线仅在生产中匹配

时间:2014-10-13 19:36:30

标签: ruby-on-rails apache routes passenger

我遇到了一个真正奇怪的问题。

我通过Passenger(使用Apache)部署我的应用程序。当我在我的计算机上试用我的应用程序时,一切都很好但是当我部署它时,我遇到了一些路线问题......在生产中找不到本地的找到路线。

我已经看过并试过this post但是它没有用。

我在资产和预编译方面遇到了一些麻烦。我以为它已经完成但最终没有。

如果我尝试:

localhost:3000/api/my_key

myurl/api/my_key

我的服务器上出现此错误:

ActionController::RoutingError (No route matches api/8dd8ec0f20a25777775d02655f7af8ec1918b)
  app/controllers/application_controller.rb:39:in `unmatched_route'

routes.rb

[...]
scope constraints:  Rails.configuration.api_routing,
  defaults:     Rails.configuration.api_routing do
    namespace :api do
      ..
    end
  end
end

Application.rb

config.api_routing = {host: "myurl"}

ApplicationController.rb

def unmatched_route
  raise ActionController::RoutingError.new("No route matches #{params[:unmatched_route]}")
end

有没有人有想法?

提前谢谢。

1 个答案:

答案 0 :(得分:0)

问题解决了,它来自我的DNS重定向,而不是来自我的应用。此问题与this one相关联。

相关问题