0

Hi So I recently added some coffeescript from a tutorial for card validations with stripe. I am getting an error i dont understand so if someone could give me any guidance it would be most appreciated.

ExecJS::RuntimeError in Devise::Sessions#new
SyntaxError: [stdin]:6:22: reserved word "function"
Extracted source (around line #6):

Site <%= 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"] %>

I have tried adding various things to the gemfile but to no joy, here is the relevant part of the application.html

<!DOCTYPE html>
<html>
<head>
  <title>Site</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>

and here is the gemfile....

source 'https://code.stripe.com'
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'

gem 'bootstrap-sass'

gem "paperclip"
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

gem 'devise'

gem 'figaro'

gem 'stripe'

gem 'therubyracer'

gem 'coffee-script-source'

group :production do 
  gem 'pg'
  gem 'rails_12factor'
end

group :development, :test do 
  gem 'sqlite3'
end

1 Answer 1

0

I think this was a problem with indentation, when deleting the coffeescript file and trying again it worked...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.