0

我的应用程序在我的本地机器上运行,但在 Heroku 上运行,但是在我添加Google Maps并使用我的Twitter Bootstrap布局后推送它之后,它停止在 Heroku 上运行。

我在 Heroku 日志中收到此错误:

ActionView::Template::Error ('twitter/bootstrap/bootstrap.less' wasn't found.

我对 RoR 还很陌生,不确定我的 Google 地图脚本是否适用于我的 application.html.erb 和 show.html.erb

应用程序.html.erb

<!DOCTYPE html>
<html>
<head>
  <title><%= full_title(yield(:title)) %></title>
  <!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
  <%= stylesheet_link_tag "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <script src="http://maps.googleapis.com/maps/api/js?key=[I PUT MY API KEY HERE]&sensor=false"> </script>
  <%= csrf_meta_tags %>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
.
.
.

显示.html.erb

<script>
var myCenter=new google.maps.LatLng(<%= @hikingtrail.latitude %>, <%= @hikingtrail.longitude %>);

function initialize()
{
var mapProp = {
  center:myCenter,
  zoom:10,
  mapTypeId:google.maps.MapTypeId.ROADMAP
  };

var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);

var marker=new google.maps.Marker({
  position:myCenter,
  });

marker.setMap(map);
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>


<% provide(:title, @hikingtrail.name) %>
<!-- <p id="notice"><%= notice %></p> -->
.
.
. 

    <div class="tab-pane fade in active" id="map">
      <a target="_blank" href='https://maps.google.ie/maps?q=<%= @hikingtrail.address %>'> Open in GoogleMaps </a>
      <br />
      <div id="googleMap" style="width:100%;height:300px;"></div>
    </div>
.
.
.

Heroku 日志

2013-04-03T17:54:36+00:00 app[web.1]: => Rails 3.2.12 application starting in production on http://0.0.0.0:51640
2013-04-03T17:54:36+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-04-03T17:54:36+00:00 app[web.1]: => Booting WEBrick
2013-04-03T17:54:36+00:00 app[web.1]: => Call with -d to detach
2013-04-03T17:54:36+00:00 app[web.1]: Started GET "/" for 193.1.209.100 at 2013-04-03 17:54:36 +0000
2013-04-03T17:54:36+00:00 app[web.1]: Processing by HikingtrailsController#index as HTML
2013-04-03T17:54:37+00:00 app[web.1]:   Rendered hikingtrails/index.html.erb within layouts/application (80.3ms)
2013-04-03T17:54:37+00:00 app[web.1]: WARN: tilt autoloading 'less' in a non thread-safe way; explicit require 'less' suggested.
2013-04-03T17:54:38+00:00 app[web.1]: Completed 500 Internal Server Error in 2094ms
2013-04-03T17:54:38+00:00 app[web.1]: 
2013-04-03T17:54:38+00:00 app[web.1]: ActionView::Template::Error ('twitter/bootstrap/bootstrap.less' wasn't found.
2013-04-03T17:54:38+00:00 app[web.1]: 
2013-04-03T17:54:38+00:00 app[web.1]:   (in /app/app/assets/stylesheets/bootstrap_and_overrides.css.less)):
2013-04-03T17:54:38+00:00 app[web.1]:     5:   <!--[if lt IE 9]>
2013-04-03T17:54:38+00:00 app[web.1]:     7: <![endif]-->
2013-04-03T17:54:38+00:00 app[web.1]:     8:   <%= stylesheet_link_tag "application", :media => "all" %>
2013-04-03T17:54:38+00:00 app[web.1]:     6: <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
2013-04-03T17:54:38+00:00 app[web.1]:   app/controllers/hikingtrails_controller.rb:11:in `index'
2013-04-03T17:54:38+00:00 app[web.1]: 
2013-04-03T17:54:38+00:00 app[web.1]:   app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb__2890293300082615835_33779640'
2013-04-03T17:54:38+00:00 app[web.1]:     9:   <%= javascript_include_tag "application" %>
2013-04-03T17:54:38+00:00 app[web.1]:     10:   <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDDXT3NtHX42AZZapNvA6-Dj3xls_YhfT0&sensor=false"> </script>
2013-04-03T17:54:38+00:00 app[web.1]:     11:   <%= csrf_meta_tags %>
2013-04-03T17:54:38+00:00 app[web.1]: 
4

0 回答 0