Notes from Paul's install
Update Ruby to Latest Version on Mac OS X – The Coding Pad
heroku create Creating app... done, ⬢ pacific-fortress-82024 https://pacific-fortress-82024.herokuapp.com/ | https://git.heroku.com/pacific-fortress-82024.git
Arron: https://afternoon-crag-46310.herokuapp.com/ | https://git.heroku.com/afternoon-crag-46310.git
AIzaSyAXZbTnHGQ-80pXHD5TK_Rq7LDuTWZSVaE
AIzaSyCJnHS662l7UYK3EKYDwwuGtaFfnlc1qBU
AIzaSyAhJj7KI0SOUpT3-dUrT5bGHibT9fD7Zd0
https://pacific-fortress-82024.herokuapp.com/ deployed to Heroku
heroku login
heroku create
Creating app... done, ⬢ blooming-crag-36791
https://blooming-crag-36791.herokuapp.com/ | https://git.heroku.com/blooming-crag-36791.git
Goto Google API and get a KEY and set it for the URL above.
- Goto Google Cloud Platform
- Click APIs & Services -> Credentials
- Select or Create depending if you have a key setup or not.
- Update the following files with the API key
- app/views/layouts/application.html.erb
- lib/google_maps/static_generator.rb
- spec/lib/google_maps/static_generator_spec.rb
git push heroku master
GOOGLE API KEYS in two places
RAKE - set DB, Name, User, Password then ran
heroku run rake db:migrate db:seed
If it does not work try....
- Goto Huruko Web Page
- Clcik on the app
- Goto Resources tab
- Click on 'Heroku postress :: database'
- Click on Settings tab
- Click on View Credentials
- Remember Credentials
- Goto Huruko Web Page
- Click on App
- Click on Setting
- Clcik on Reveal Config Vars
- Add
- DATABASE_NAME
- DATABASE_USER
- DATABASE_PASSWORD
App should work now
Google Maps shows "For development purposes only" - Stack Overflow
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -6,7 +6,7 @@
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
- <script src="//maps.googleapis.com/maps/api/js?sensor=false&key=AIzaSyCvmxpgAeNj2rYwL54kqzkGSrvAvapNt4A"></script>
+ <script src="//maps.googleapis.com/maps/api/js?sensor=false&key=AIzaSyAOou3HcMJA52b4ZNVKD23RvYZEWDF9i1M"></script>
</head>
<body >
<div id="root" class="application-wrapper"></div>
diff --git a/lib/google_maps/static_generator.rb b/lib/google_maps/static_generator.rb
index 06c5676..40fd537 100644
--- a/lib/google_maps/static_generator.rb
+++ b/lib/google_maps/static_generator.rb
@@ -15,7 +15,7 @@ module GoogleMaps
private
def api_key
- '&key=AIzaSyCvmxpgAeNj2rYwL54kqzkGSrvAvapNt4A'
+ '&key=AIzaSyAOou3HcMJA52b4ZNVKD23RvYZEWDF9i1M'
end
def styles
--- a/spec/lib/google_maps/static_generator_spec.rb
+++ b/spec/lib/google_maps/static_generator_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe GoogleMaps::StaticGenerator do
describe '#generate_static_api_uri' do
it 'includes the correct api key' do
- expect(subject.generate_static_api_uri).to include('key=AIzaSyCvmxpgAeNj2rYwL54kqzkGSrvAvapNt4A')
+ expect(subject.generate_static_api_uri).to include('key=AIzaSyCJnHS662l7UYK3EKYDwwuGtaFfnlc1qBU')
end
it 'includes the correct size' do
@@ -78,4 +78,4 @@ RSpec.describe GoogleMaps::StaticGenerator do
end
end
end
-end
\ No newline at end of file
+end