我被一个很奇怪的问题困住了。
我正在部署我的应用程序通过乘客(与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
endApplication.rb
config.api_routing = {host: "myurl"}ApplicationController.rb
def unmatched_route
  raise ActionController::RoutingError.new("No route matches #{params[:unmatched_route]}")
end有谁有主意吗?
提前谢谢你。
发布于 2014-10-23 07:58:41
问题解决了,它来自我的DNS重定向,而不是我的应用程序。这个问题与this one有关。
https://stackoverflow.com/questions/26347599
复制相似问题