【发布时间】:2021-01-05 02:16:41
【问题描述】:
我的 rails 应用程序在开发中运行良好。但是当我在 VPS 上将其部署到生产环境时,页面无法加载。
当我在日志上运行tail时加载paige时
tail -f /var/www/myapp/code/log/production.log
我得到以下错误
INFO -- : [1c740360-49a5-4920-9dfd-47673fbd4eee] Started GET "/" for 27.0.0.1 at 2021-01-04 14:45:11 +0000
INFO -- : [1c740360-49a5-4920-9dfd-47673fbd4eee] Processing by DashboardController#index as HTML
INFO -- : [1c740360-49a5-4920-9dfd-47673fbd4eee] Rendering dashboard/index.html.erb within layouts/application
INFO -- : [1c740360-49a5-4920-9dfd-47673fbd4eee] Rendered dashboard/index.html.erb within layouts/application (Duration: 1.0ms | Allocations: 394)
INFO -- : [1c740360-49a5-4920-9dfd-47673fbd4eee] Completed 500 Internal Server Error in 3ms (Allocations: 710)
FATAL -- : [1c740360-49a5-4920-9dfd-47673fbd4eee] ActionView::SyntaxErrorInTemplate (Encountered a syntax error while rendering template: check
Rails 将我指向 app/view/dashboard/index.html.erb 的代码,如下所示。
<br><br><br><br><br>
<section>
<div class="block center-text">
<header class="header-group">
<h3>Welcome to Igbo Progressive Union, Connecting Igbo's, around the world.</h3>
</header>
<div class="row">
<div class="col-md-12">
</div>
</div>
</div>
</section>
<%= flash_messages %>
<section id="welcome">
<!-- ======= Top banner ======= -->
<div class="jumbotron img-centre">
<div background: url("../images/welcomeimage.jpeg") >
<p>
<br><br><br><br><br><br><br><br>
<a class="btn btn-primary btn-lg" href="#about">Learn more</a>
</p>
</div>
</div>
</section>
<section id="about">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">About IPU</h3>
</div>
<div class="panel-body">
<table class="table-responsive">
<tbody>
<tr>
<td><a><%= image_tag "ipu_logo1.jpg", width:"auto", height:"200", alt="ipu_logo" %></a></td>
<td conspan="7">
<div class="well">
<p>We promote, protect and defend the interest of our members and their dependants around the world. We strive to create awareness of our culture and roots among ourselves and our children. Furthermore IPU promotes social interaction amongst the members of the community and and our members to enhance good relations between our Igbo community and other communities in Nigeria, United Kingdom, USA and throughout the world.</p>
</div>
</td>
<td><a><%= image_tag("IMG_6240.JPG", width:"auto", height:"200") %></a></td>
</tr>
</tbody>
</table>
<div class="well">
<p>Our goal is to continously promote Igbo language and culture (Omenani) everywhere in the world where Igbo's reside. We provide a common platform for Igbo's to engage in conversations concerning our culture and tradition, and share information to promote our ideologies. There are extended benefits for financial members, that include support in times of need, such as bereavement, child birth, hospitalization and many more. You can participate on our platform as a standard member at no extra cost by registering on our home page. If you enjoy what we are doing and want to support us, please make a voluntary contrubition to support our global efforts. However becoming a financial member, makes you eligible for all benefits and support as stated in our Articles of Association (constitution) as may be amended from time to time by the general assembley.</p>
</div>
</div>
</div>
</section>
<section id="objectives">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Objectives of IPU</h3>
</div>
<div class="panel-body">
<table class="table-responsive">
<tbody>
<tr>
<td>
<ol type="1">
<li>To promote brotherhood, friendship and unity amongst the Igbo community living in Northamptonshire, the United Kingdom, Nigeria, and throughout the world as well as integrating with other communities.</li>
<li>To support the welfare of IPU members whether that be morally, financially or otherwise in causes which in the opinion of the General Meeting merit the support of members.</li>
<li>To promote and create awareness of the Igbo Language and culture within Northamptonshire and the United Kingdom in general through cultural events, festivals, seminars, and speaking Igbo.</li>
<li>To organise lectures and educational trips about Igbo language, culture and heritage to the children of IPU members.</li>
<li>In accordance with Igbo tradition to observe “OMENANI” where appropriate to do so.</li>
</ol>
</td>
<td><a><%= image_tag("IMG_66131.JPG", width:"auto", height:"200") %></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="contact">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Contact Us</h3>
</div>
<div class="panel-body">
<table class="table-responsive">
<tbody>
<tr>
<td><%= image_tag("IMG_62471.JPG", width:"auto", height:"200") %></td>
<td>
<p>Pastor </p>
<p>Phone: +44</p>
<br>
<p>Barr </p>
<p>Phone: +44</p>
<br>
<p>Gideon </p>
<p>Phone: +44</p>
<br>
<p>Chidi </p>
<p>Phone: +44</p>
<br>
<p>Kingsley </p>
<p>Phone: +44</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
我的麻烦是我找不到任何语法错误。最后,最重要的是,下面的错误被抛出。
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:42: syntax error, unexpected ')', expecting =>
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:121: syntax error, unexpected `end', expecting ')'
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:42: syntax error, unexpected ')', expecting =>
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:121: syntax error, unexpected `end', expecting ')'
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:42: syntax error, unexpected ')', expecting =>
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:121: syntax error, unexpected `end', expecting ')'
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:42: syntax error, unexpected ')', expecting =>
[7897e223-644d-47ba-bc0c-1eb65772a76d] app/views/dashboard/index.html.erb:121: syntax error, unexpected `end', expecting ')'
但是,我什至在 app/views/dashboard/index.html.erb:121 中没有任何第 121 行,因为代码在第 119 行之前完成。
我怎样才能找到这个语法错误?。欢迎任何和所有想法。我的生产服务器配置如下所示
Ubuntu 20.04 Ruby 2.7.2 与 RVM rvm 1.29.11 网络服务器:乘客 NGINX 数据库:Mysql 8.0
【问题讨论】:
-
完美。就是这样。非常感谢您。将此作为答案,以便我可以访问它。
标签: ruby-on-rails ruby