我在Rails中有一個房間預訂項目。我在其中一個頁面中遇到了問題,我在其中修復並推送了更改。解決這個問題後,我的主頁面,新的預訂頁面出現了一個錯誤,只發生在Heroku上,而不是在本地主機上。 (很抱歉,但出了點問題。)Rails應用程序在本地服務器上工作,但最重要的頁面不會在Heroku上工作
我看不到它宣稱我有的錯誤。爲了解決這個問題,我將Heroku回滾到主頁正在工作的狀態,而我之前修復的頁面不是:主頁再次工作。然後,我將Heroku中的git克隆到我的本地機器中,然後重新推送它,但沒有發生任何變化,但錯誤再次出現!我用Heroku Bash確認服務器上的文件實際上是我推送的文件。
我真的很感謝一些幫助!
兩個從Heroku的日誌中的錯誤:
2014-09-27T21:53:41.455914+00:00 app[web.1]: ActionView::Template::Error (/app/app/views/reservations/new.html.erb:16: syntax error, unexpected keyword_do, expecting keyword_end
2014-09-27T21:53:41.455712+00:00 app[web.1]: /app/app/views/reservations/new.html.erb:28: syntax error, unexpected keyword_ensure, expecting end-of-input):
應用程序/視圖/預訂/ new.html.erb
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="panel panel-primary radius">
<div class="panel-heading">
<h1 class="panel-title text-center" id="reservations_title"><%= t "new_reservation.title" %>:
<span class="spinner"
style="display: none; position: relative; top:4px; left:<%= params[:locale]=="en" ? "2px;" : "4px;" %>"
id="titleSpinner">
</span>
</h1>
</div>
<div class="panel-body">
<div class="col-md-12">
<%= form_for ([@user, @reservation]), remote: true do |f| %>
<%= render(:partial => 'form_datetime', locals: { f: f }) %>
<%= render(:partial => 'shared/notifications', locals: { f: f }) %>
<%= render(:partial => 'form_rooms', locals: { f: f }) %>
<% end %>
</div>
</div>
</div>
</div>
</div>
<%= javascript_include_tag 'reservations' %>
form_datetime
個form_rooms
<div id="room_container">
<div class="form-group">
<%= submit_tag "Show Rooms", :name => "show_rooms", :class => "btn btn-info radius btn-block", :id => "show_rooms" %>
</div>
<% if(!params[:res_date].blank? && !params[:res_time].blank?) %>
<div class="form-group">
<% rooms_arr = available_rooms_array(params[:res_date],params[:res_time]) %>
<% if rooms_arr.size == 0 %>
<div class="alert alert-warning radius">
<span class="glyphicon glyphicon-exclamation-sign"></span>
<%= t "new_reservation.no_rooms" %>
</div>
<% else %>
<% rooms_arr.each do |room| %>
<button value="<%= room.name %>"
name="room_name"
class="btn btn-primary radius btn-block">
<span class="spinner"
style="display: none; position: relative; top:5px; left:<%= params[:locale]=="en" ? "8px;" : "11px;" %>"
id="buttonSpinner<%= room.name %>">
</span>
<% if room.contains_grand_piano %>
<span class="glyphicon glyphicon-star-empty"></span>
<% end %>
<%= room.name %>
</button>
<% end %>
<% end %>
</div>
<% end %>
</div>
通知
<div class="form-group" id="notifications_container">
<% if !flash.now.blank? %>
<% if !flash[:notice].blank? %>
<div class="alert alert-success radius">
<span class="glyphicon glyphicon-ok-sign"></span>
<%= flash.now[:notice].html_safe %>
</div>
<% end %>
<% if !flash[:warning].blank? %>
<div class="alert alert-warning radius">
<span class="glyphicon glyphicon-exclamation-sign"></span>
<%= flash.now[:warning].html_safe %>
</div>
<% end %>
<% if !flash.now[:error].blank? %>
<div class="alert alert-danger radius">
<span class="glyphicon glyphicon-remove-sign"></span>
<%= flash.now[:error].html_safe %>
</div>
<% end %>
<% end %>
</div>
編輯: 我也試圖做一個新的Heroku應用程序 - 錯誤也仍然存在與此應用程序。我怎樣才能找出爲什麼在Heroku的某個回滾中它確實起作用?