title: unable to display google map on ruby on rails app page in production environment in local machine
body: <p>I have problem over coffee script file  I Have written for gmaps I am using puma server in my rails5 application. my application consists of only one page which has google map. I have written all the scripts for maps in a file called home.coffee. when i run the same in development environment it runs fine but as soon as I start application in production mode it stops working. I have also made   config.assets.compile = true in production.rb file and also done assets precompiled  and starting server using command rails s -e production. any one help me out why it is not loading page.  I am attaching up my files along with question. It is unable to load even application.js file so it has issue of Javascript.San any body help me ou on my javascript coffee file If anybody can help me out, I would be great thank [Brower[while running on development mode][1\full.</p>
  
  <p><a href="https://i.stack.imgur.com/IQ0rU.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>production.rb</p>
  
  <pre><code>config.assets.compile = true
  config.serve_static_assets = true
  config.public_file_server.enabled = true
  </code></pre>
  
  <p>application.js file</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require underscore
  //= require gmaps/google
  //= require gmail_api
  //= require home
  //= require markerclusterer
  //= require infobox
  //= require turbolinks
  // require_tree .
  </code></pre>
  
  <p>home.coffee file</p>
  
  <pre><code># main function
  
  map_initialize = -&gt;
    #default marker
    marker = new (google.maps.LatLng)(28.7041, 77.1025)
    # customizing marker
    icon =
      url: 'assets/test.png'
      scaledSize: new (google.maps.Size)(30, 30)
      origin: new (google.maps.Point)(0, 0)
      anchor: new (google.maps.Point)(0, 0)
    # default options
    mapOptions =
      center: marker
      zoom: 2
      mapTypeId: google.maps.MapTypeId.ROADMAP
    # initializing map
    map = new (google.maps.Map)(document.getElementById('map-canvas'),    mapOptions)
    # restricting map to zoom level 2
    minZoomLevel = 2
    map.setOptions
      minZoom: minZoomLevel
      maxZoom: 15
    google.maps.event.addListener map, 'zoom_changed', -&gt;
      if map.getZoom() &lt; minZoomLevel
        map.setZoom minZoomLevel
      return
    # array of multiple locations
    locations = [
      {
        lat: 12.9716
        lng: 77.5946
      }
      {
        lat: 20.4925
        lng: 73.1350
      }
      {
        lat: 21.1702
        lng: 72.8311
      }
     ]
    # respects a left and right side boundary
    allowedBounds = new (google.maps.LatLngBounds)(new    (google.maps.LatLng)(-90, -150), new (google.maps.LatLng)(90, 150))
    lastValidCenter = map.getCenter()
    google.maps.event.addListener map, 'center_changed', -&gt;
      if allowedBounds.contains(map.getCenter())
        lastValidCenter = map.getCenter()
        return
       map.panTo lastValidCenter
      return
    # locating different markers on map
    markers = locations.map((location, i) -&gt;
      new (google.maps.Marker)(
        position: location
        icon: icon)
    )
     markerCluster = new MarkerClusterer(map, markers, imagePath:   'assets/m')
    #dialogbox for each marker
    infoWindowContent = []
    infoWindow = new (google.maps.InfoWindow)
    markers.map (marker, i) -&gt;
      infoWindowContent.push [ 'Dialog Box ' + (i + 1).toString() ]
      google.maps.event.addListener marker, 'click', do (marker, i) -&gt;
        -&gt;
          infoWindow.setContent infoWindowContent[i][0]
          infoWindow.open map, marker
          return
      return
    return
  
  # function to disable zooming
  
  disable = -&gt;
    map_initialize()
    map.setOptions
      draggable: false
      zoomControl: false
      scrollwheel: false
      disableDoubleClickZoom: true
    return
  
  # function to enable zooming
  
  enable = -&gt;
    map_initialize()
    map.setOptions
      draggable: true
      zoomControl: true
      scrollwheel: true
      disableDoubleClickZoom: false
    return
  
  $ -&gt;
    map_initialize()
    return
  </code></pre>