清单中的ExecJS :: RuntimeError索引错误
当我打开本地主机时 ,我收到此ExecJS错误消息 ,我不知道为什么,一些帮助会很惊人。
我在我的localhost上得到了这个
显示/…/conektec/app/views/layouts/application.html.erb,其中第6行引发:
SyntaxError:[stdin]:6:16:意外的换行符(在/…/conektec/app/assets/javascripts/orders.js.coffee中)
ActionView::Template::Error (SyntaxError: [stdin]:2:73: unmatched ) (in /Users/hbendev/startups/conektec/conektec/app/assets/javascripts/orders.js.coffee)): 3: 4: Conektec 5: true %> 6: true %> 7: 8: 9: "stripe-key", :content => ENV["STRIPE_PUBLIC_KEY"] %>
这是我的orders.js.coffee文件
jQuery -> Stripe.setPublishableKey($('meta[name="stripe-key"]').attr('content')) payment.setupForm() payment = setupForm: -> $('#new_order').submit -> $('input[type=submit]').attr('disabled', true) Stripe.card.createToken($('#new_order'), payment.handleStripeResponse) false handleStripeResponse: (status, response) -> if status == 200 alert(response.id) else alert(response.error.message)
这是我的application.html.erb文件
Conektec true %> true %> "stripe-key", :content => ENV["STRIPE_PUBLIC_KEY"] %> <div class="alert alert- alert-dismissable"> "flash_#{name}" %>