Forum: Ruby on Rails Google Earth/Map API key problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e5ff0bd7d45271ef02a374f395ce08d?d=identicon&s=25 icewoman (Guest)
on 2008-11-29 13:36
(Received via mailing list)
I'm trying to have my Rails app create a web page showing the Google
Earth API.  I've been having some problems with it, but finally got
the window to come up by putting all the javascript code in as a
javascript_tag in my rhtml..  Now I keep getting the an error that my
key is registered for a different website..  Even though I've created
new keys for "localhost:3000" and my production website.

Anyone know what might be the problem?

I saw a previous potentially relevant posting that talked about
routing, but I'm thinking that they key is supposed to work for ANY
page served off that site?

Thanks for any help you can provide!

-Lisa
B8a5eee5fd5ddff3badf7d4ab77653d4?d=identicon&s=25 brady8 (Guest)
on 2008-11-29 18:40
(Received via mailing list)
Just a thought, but I suspect that you're not going to be able to use
the API locally without that error message. Although your computer
calls itself "localhost", from Google's end your computer is most
likely just an IP address (no reverse DNS set up), or something like
lisas-computer.wireless.ualberta.ca (for example, what your computer
might resolve to on campus at my university).

The API documentation might say something about how to run it locally
without error?

-Brady
1e5ff0bd7d45271ef02a374f395ce08d?d=identicon&s=25 icewoman (Guest)
on 2008-11-29 20:55
(Received via mailing list)
Thanks for the suggestion!

You could be right about the local run, although some of the earlier
posts talked about getting a key for "localhost."  Unfortunately, I'm
having the same problem with my production web site.

Also, if one has an ordinary html web page, google doesn't seem to
look at the key when it's on the computer.

One more detail that could be relevant:  if I view source and then
save the results to an html file, that works fine on my machine, but
not if I put the one with the production site's key in the public
directory within my rails app on the production site.

So it really seems that google is seeing the rails app as something
other than the url it's on.

-Lisa
1e5ff0bd7d45271ef02a374f395ce08d?d=identicon&s=25 icewoman (Guest)
on 2008-11-30 19:28
(Received via mailing list)
I'm not completely sure what I did to fix this, but I started from
scratch with the sample map provided with the key, and it works now on
my local machine.

One possibility is that the scripts were outside the head in some of
my attempts.  Although that doesn't quite explain the reason the saved
html version worked, so I think there were multiple issues.
1e5ff0bd7d45271ef02a374f395ce08d?d=identicon&s=25 icewoman (Guest)
on 2008-11-30 20:39
(Received via mailing list)
One more trick: don't try to use a rails command for the key.  Just
put the keyfile info in the header as it appears in your sample code
(as modified for Google Earth API vs. maps.)
This topic is locked and can not be replied to.