1

After an upgrade of ruby and rails performed on an old app, I get the following error when trying to access to any of the app views:

SyntaxError: [stdin]:3:1: unexpected indentation

It seems that some file related to The Ruby Racer gem may be causing this issue.

Ruby 2.3.1p112, Rails 4.0.13, therubyracer 0.12.3

In the server log:

ExecJS::RuntimeError - SyntaxError: [stdin]:3:1: unexpected indentation:
  execjs (2.7.0) lib/execjs/ruby_racer_runtime.rb:98:in `wrap_error'
  execjs (2.7.0) lib/execjs/ruby_racer_runtime.rb:47:in `rescue in block in call'
  execjs (2.7.0) lib/execjs/ruby_racer_runtime.rb:44:in `block in call'
  execjs (2.7.0) lib/execjs/ruby_racer_runtime.rb:75:in `block in lock'
  execjs (2.7.0) lib/execjs/ruby_racer_runtime.rb:73:in `lock'
  execjs (2.7.0) lib/execjs/ruby_racer_runtime.rb:43:in `call'
  coffee-script (2.4.1) lib/coffee_script.rb:78:in `compile'

Update

Using a previous version of therubyracer such as gem 'therubyracer', '~> 0.10.2' does not fix the problem.

4

1 回答 1

7

在编译您的一个咖啡脚本时出现编译错误。您应该检查coffee文件assets/javascript夹中的文件。

为了帮助您更轻松地调试问题所在(哪一行),您可以尝试手动安装咖啡脚本(http://coffeescript.org)并使用命令行编译器。

于 2017-03-27T08:55:17.043 回答