I'm running into a "Gmaps is not defined" JS error on Heroku (maps load up okay locally). I know there are a lot of similar questions out there on this issue but I've tried all sorts of hacks from their suggestions but am still stuck. Any help would be awesome.
Loading up the view locally produces a map but on Heroku I get the Gmaps error and the map box is blank.
Application.js looks like
//= require twitter/bootstrap
//= require bootstrap
//= require jquery
//= require jquery_ujs
//= require gmaps4rails/gmaps4rails.googlemaps
//= require gmaps4rails/gmaps4rails.base
//= require_tree .
Application.html.erb has
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "gmaps4rails" %>
<%= csrf_meta_tags %>
And I render <%= yield :scripts %>
at the bottom of the body
I call <%= gmaps4rails(@json) %>
in a view and the markers param is populating as expected.
Application.rb has the following settings (in addition to other unrelated ones):
config.assets.precompile << /(^[^_\/]|\/[^_])[^\/]*$/
config.encoding = "utf-8"
config.assets.enabled = true
config.assets.initialize_on_precompile = false
config.assets.version = '1.1'
production.rb has the following:
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.assets.compress = true
config.assets.compile = false
config.assets.digest = true
config.assets.initialize_on_precompile = false
I love using this gem but have really bashed my head on this issue for quite some time. Thanks.