views:

539

answers:

1

Hi,

I've been working on a Google Maps based Rails app and it was working fine until I installed Phusion's Passenger and now Google Maps API won't recognise the API Key which I generated for http://localhost:3000.

Now I'm running Passenger, the URL for my app is http://mygooglemapsapp.local. I've generated a Google Maps API key using this new URL but I'm still getting the same error.

"The Google Maps API server rejected your request. This could be because the API key used on this site was registered for a different web site. You can generate a new key for this web site at %1$s."

What URL should I give Google Maps API so it will recognise the Passenger generated URL?

Thanks in advance.

Nick

+1  A: 

Depending on your Apache config (I'm assuming this is an OS X install from the .local URL) you might be able to change the set-up such that you run multiple Rails apps via http://localhost/MY_APP/

There's some good examples on setting up mod_rails for multiple directories here

Pay attention to the example for deploying multiple apps under one VirtualHost. If you can get this configured, then you can just request a Google Maps API Key for http://localhost/ and reuse it as much as you need in development.

Scott