0

I'm stuck with a real strange problem.

I'm deploying my app through Passenger (with Apache). When I try my app on my computer everything is fine but when I deploy it, I have some troubles with routes... Found routes in local are not found in production.

I've seen and tried this post but it's not working.

I had some troubles with assets and precompilation. I thought it was done but finally not.

If I try:

localhost:3000/api/my_key

myurl/api/my_key

I have this error on my server:

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

What can I try next?

halfer
  • 19,824
  • 17
  • 99
  • 186
brcebn
  • 1,571
  • 1
  • 23
  • 46
  • Can you include rake routes output for the production server? ```RAILS_ENV=production rake routes``` – KPheasey Oct 13 '14 at 20:43
  • Some log entries would be helpful, combined with an example of working on development and not working in production routes. Also, be sure to set your application root to /path-to-your-app/public – Ruby Racer Oct 13 '14 at 20:43
  • I've added an example. My app is running but not all routes actually. And I've notice that my url never changes. Maybe it will help. Thank you for your time. – brcebn Oct 13 '14 at 21:37
  • When I check the routes on my production server I can see routes I'm looking for. – brcebn Oct 13 '14 at 21:46

1 Answers1

0

Problem solved, it came from my DNS redirection and not from my app. This issue was linked to this one.

Community
  • 1
  • 1
brcebn
  • 1,571
  • 1
  • 23
  • 46