I put this <script src="https://maps.googleapis.com/maps/api/js?key=$API_KEY&callback=initMap" async> </script> on recipes/map.html.erb and i removed all application.js code and meta tag with api key from layouts/application.html.erb because it dosen't work in production. Thanks!