Ruby on rails 地图未显示(使用gmaps4rails gem)

Ruby on rails 地图未显示(使用gmaps4rails gem),ruby-on-rails,google-maps,gmaps4rails,Ruby On Rails,Google Maps,Gmaps4rails,我正在使用gmaps4rails gem生成一张地图,其中包含我所在大学校园内的几个建筑位置 然而,我似乎无法让地图显示出来。 出现了一个空盒子,但仅此而已 型号:(仅包括与gmaps4rails功能相关的行) 视图: Application.js: // This is a manifest file that'll be compiled into including all the files listed below. // Add new JavaScript/Coffee code

我正在使用gmaps4rails gem生成一张地图,其中包含我所在大学校园内的几个建筑位置

然而,我似乎无法让地图显示出来。 出现了一个空盒子,但仅此而已

型号:(仅包括与gmaps4rails功能相关的行)

视图:

Application.js:

// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require ./gmaps4rails/googlemaps.js
//= require jquery
//= require jquery_ujs
//= require_tree .
我还尝试在视图中包含
。不走运

我当前的屏幕如下所示:

当我查看
@json
时,它的内容似乎是正确的。由于某种原因,地图没有显示出来

我已经做了几个小时了。我似乎想不出这个问题。查看了过去似乎与此问题相关的多个问题

编辑:可能是gem的版本吗?我的是1.5.6 我注意到有一个2.0.0.pre。。。不知道那是什么

编辑2:嗯。。。不知道如何检查。有点小毛病。我创建了一个heroku应用程序,并试图将我的代码推送到那里。现在,当我尝试对数据库进行种子设定时,我得到了一个
未定义的局部变量或方法作为#
的_gmappable。不知道这是否与我的另一个问题有关

我想是的。我也浏览了好几篇文章,似乎都是正确的。再说一次,也许我错过了什么。。。还在调查。开始让我发疯了

(哦,我也在使用JQuery Mobile。我发现了这个过去的问题。我是否将脚本放在application.html.erb或Mobile.html.erb中?此外,
似乎不起作用。不需要3个参数


至于
的一部分,我是否应该在这个分区中添加

是否有任何错误记录到客户端控制台?您是否重新启动了应用程序,并确保您已准备好所有CSS和JS所有必要的JS文件都不存在,请阅读文档,哇哦。是的,地图在这一点上工作了。必须把您的p我的回答结束了这个问题。
<%= stylesheet_link_tag 'gmaps4rails' %>

<%= gmaps4rails(@json) %>
  def map
     @json = Hall.all.to_gmaps4rails
  end
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require ./gmaps4rails/googlemaps.js
//= require jquery
//= require jquery_ujs
//= require_tree .