ROR中的错误:ActionView :: Template :: Error(nil:NilClass的未定义方法“ *”):

时间:2020-10-30 04:32:56

标签: ruby-on-rails syntax-error

有人可以帮我解决这个问题吗?我不确定这里出了什么问题,遇到了以下错误,无法修复。

请在下面找到错误日志:

D, [2020-10-29T17:30:17.411451 #15204] DEBUG -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823]   CACHE RateConversion Load (0.0ms)  SELECT  "rate_conversions".* FROM "rate_conversions" WHERE "rate_conversions"."currency" = $1 LIMIT $2  [["currency", "USD"], ["LIMIT", 1]]
I, [2020-10-29T17:30:17.412714 #15204]  INFO -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823]   Rendered layouts/_dashboard_header.html.erb (4.1ms)
I, [2020-10-29T17:30:17.412890 #15204]  INFO -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823] Completed 500 Internal Server Error in 2656ms (ActiveRecord: 661.6ms)
F, [2020-10-29T17:30:17.413688 #15204] FATAL -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823]  
F, [2020-10-29T17:30:17.413729 #15204] FATAL -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823] ActionView::Template::Error (undefined method `*' for nil:NilClass):
F, [2020-10-29T17:30:17.413941 #15204] FATAL -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823]     111:         <a href="javascript:void(0)" class=""><i class="fas fa-sign-in-alt"></i> Shop Nebula Marketplace</a>
[20d4f105-45a7-4ed7-a44f-efc2c361d823]     112:       </div>-->
[20d4f105-45a7-4ed7-a44f-efc2c361d823]     113:       <div class="contact-sales n-cash">
[20d4f105-45a7-4ed7-a44f-efc2c361d823]     114:         <strong class="highlight"><%= rate_conversion(pundit_user.balance)%></strong>
[20d4f105-45a7-4ed7-a44f-efc2c361d823]     115:         <span class="contact-text">Nebula Credits</span>
[20d4f105-45a7-4ed7-a44f-efc2c361d823]     116:       </div>
[20d4f105-45a7-4ed7-a44f-efc2c361d823]     117:       <div class="contact-sales"><a href="/users/sessions/contact"><i class="fas fa-envelope"></i><span class="contact-text"> Contact
F, [2020-10-29T17:30:17.413977 #15204] FATAL -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823]  
F, [2020-10-29T17:30:17.414003 #15204] FATAL -- : [20d4f105-45a7-4ed7-a44f-efc2c361d823] app/helpers/transactions_helper.rb:9:in `rate_conversion'
[20d4f105-45a7-4ed7-a44f-efc2c361d823] app/views/layouts/_dashboard_header.html.erb:114:in `_app_views_layouts__dashboard_header_html_erb__3915217918812131416_76820480'
[20d4f105-45a7-4ed7-a44f-efc2c361d823] app/views/layouts/application.html.erb:22:in `_app_views_layouts_application_html_erb___1593584958351649404_70343345222120'

代码如下:

</header>
<% if current_user.present? %>
<% if request.fullpath == '/' || request.fullpath == '/market_place' || request.fullpath == '/users/sessions/index' || request.fullpath.split('?')[0] == '/users/app_packages' || request.fullpath.split('?')[0] == '/product_list' || request.fullpath == "/cloud_brokerage" || request.fullpath == "/market_as_service" || request.fullpath == "/users/sessions/contact" || request.fullpath == "/about_us" || request.fullpath == "/faq" || request.fullpath == "/contact" || request.fullpath == '/daas' || request.fullpath == '/daas2' || request.fullpath == '/users/sessions/change_password' || request.fullpath == '/preview_user_guide' || request.fullpath == '/user_machines/sla' || request.fullpath == '/users/app_packages/product_detail' || request.fullpath.split('/')[3] == 'product_detail' || request.fullpath == '/trial_room' || request.fullpath == '/edulab' || request.fullpath == '/compulab' || request.fullpath == '/daas' || request.fullpath == '/daas2' || request.fullpath == '/nebula_support' || request.fullpath == '/all_categories' || request.fullpath == '/tcos' || request.fullpath == '/tcos/new' || request.fullpath == '/blog' || request.fullpath == '/career' || request.fullpath == '/case_studies' || request.fullpath == '/news_room' || request.fullpath == '/training' || request.fullpath == '/consulting' || request.fullpath == '/customer_success_stories' || request.fullpath == '/documentations' || request.fullpath == '/member_offers' || request.fullpath == '/events' || request.fullpath == '/press_releases' || request.fullpath == '/webinars' || request.fullpath == '/billing_management' || request.fullpath == '/account_management' || request.fullpath == '/partner_management' || request.fullpath == '/help_desk' || request.fullpath == '/forum' || request.fullpath == '/help_desk' || request.fullpath == '/contact_sales' || request.fullpath == '/contact_marketing' || request.fullpath == '/sales_support' || request.fullpath == '/about_comnet'%>
<% else %>
<div class="side-navigation">

我不是开发人员,但尝试以最少的知识对其进行修复。

0 个答案:

没有答案