I'm receiving this ExecJS error message when I open my localhost, I don't know why, some help would be amazing.
I got this on my localhost
Showing /.../conektec/app/views/layouts/application.html.erb where line #6 raised:
SyntaxError: [stdin]:6:16: unexpected newline (in /.../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: <head>
4: <title>Conektec</title>
5: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6: <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7: <%= javascript_include_tag "https://js.stripe.com/v2/" %>
8: <%= csrf_meta_tags %>
9: <%= tag :meta, :name => "stripe-key", :content => ENV["STRIPE_PUBLIC_KEY"] %>
Here is my orders.js.coffee file
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)
Here's my application.html.erb file
<!DOCTYPE html>
<html>
<head>
<title>Conektec</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= javascript_include_tag "https://js.stripe.com/v2/" %>
<%= csrf_meta_tags %>
<%= tag :meta, :name => "stripe-key", :content => ENV["STRIPE_PUBLIC_KEY"] %>
</head>
<body>
<%= render 'layouts/header' %>
<div class="container">
<% flash.each do |name, msg| %>
<% if msg.is_a?(String) %>
<div class="alert alert-<%= name.to_s == 'notice' ? "success" : "danger" %> alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
</div>
<% end %>
<% end %>
<%= yield %>
<%= render 'layouts/footer' %>
</div>
</body>
</html>
I already tried deleting my turbolinks, adding the rubyracer gem, I have nodejs installed, I don't know where's the error.
I'm using: OS X Mavericks Ruby 2.0.0 Rails 4.1.1
What's wrong? Thanks.