我在app / assets / javascripts /中创建了一些js文件,然后运行了rake assets:precompile
,但是rails生成了这个错误。
rake aborted!
Unexpected token: operator (>) (line: 14562, col: 9, pos: 545705)
Error<br />
at new JS_Parse_Error (<eval>:1720:22)<br />
at js_error (<eval>:1728:15)<br />
at croak (<eval>:2189:17)<br />
at token_error (<eval>:2196:17)<br />
at unexpected (<eval>:2202:17)<br />
at <eval>:2580:17<br />
at maybe_unary (<eval>:2665:27)<br />
at expr_op (<eval>:2685:45)<br />
at expr_ops(:2692:24)
在maybe_conditional(:2696:28)
在maybe_assign(:2720:28)
at:2734:28
在prog1(:2768:23)
(在/home/anybuy/anybuy/app/assets/javascripts/application.js)
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execj-> &GT; 1.4.0 / lib / execjs / ruby_racer_runtime.rb:34:在rescue in block in eval' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execjs-> 1.4.0/lib/execjs/ruby_racer_runtime.rb:28:in
块中的eval&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execjs-> 1.4.0 / lib / execjs / ruby_racer_runtime.rb:80:inblock in lock'<br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execjs-> 1.4.0/lib/execjs/ruby_racer_runtime.rb:78:in
来电&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execjs-> 1.4.0 / lib / execjs / ruby_racer_runtime.rb:78:Locker' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execjs-> 1.4.0/lib/execjs/ruby_racer_runtime.rb:78:in
锁定&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execjs-> 1.4.0 / lib / execjs / ruby_racer_runtime.rb:27:ineval' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/execjs-> 1.4.0/lib/execjs/ruby_racer_runtime.rb:19:in
exec&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/uglifier-1.3.0/lib/uglifier.rb:100:in&gt;compile' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8/lib/sprockets/compressors.rb:74:in
compress&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / processing.rb:265:在block in js_compressor=' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/processor.rb:29:in
电话&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / processor.rb:29:在evaluate' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/tilt-1.3.3/lib/tilt/template.rb:76:in >
渲染&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / context.rb:177:block in evaluate' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/context.rb:174:in
每个&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / context.rb:174:在evaluate' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/bundled_asset.rb:26:in
初始化&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / base.rb:244:在new'<br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/base.rb:244:in
build_asset&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / index.rb:89:inblock in build_asset' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/caching.rb:19:in
cache_asset&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / index.rb:88:inbuild_asset' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/base.rb:163:in
find_asset&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / index.rb:56:在find_asset' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8/lib/sprockets/static_compiler.rb:23:in
块中编译&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / base.rb:212:在block in each_logical_path' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/base.rb:200:in
块中(每个文件中有2个级别)&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / base.rb:190:each' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/base.rb:190:in
each_entry&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / base.rb:198:block in each_file' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/base.rb:197:in
每个&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3 / lib / sprockets / base.rb:197:在each_file' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/sprockets-> 2.1.3/lib/sprockets/base.rb:210:in
each_logical_path&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8 / lib / sprockets / static_compiler.rb:18:incompile' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8/lib/sprockets/assets.rake:56:in
internal_precompile&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8 / lib / sprockets / assets.rake:70:inblock (3 levels) in <top (required)>' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8/lib/sprockets/assets.rake:60:in
块(3级)in&#39;
任务:TOP =&gt;资产:预编译:主要的 (通过使用--trace运行任务查看完整跟踪)
耙子流产了!
命令失败,状态为(1):[/ home /anybuy / .rvm / rubies / ruby-1.9.3-p392 / b ...]
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8 / lib / sprockets / assets.rake:12:inruby_rake_task' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8/lib/sprockets/assets.rake:21:in
invoke_or_reboot_rake_task&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/gems/actionpack-> 3.2.8 / lib / sprockets / assets.rake:29:在block (2 levels) in <top (required)>' <br /> /home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/bin/ruby_noexec_wrapper:14:in
eval&#39;
/home/anybuy/.rvm/gems/ruby-1.9.3-p392@3.2.8/bin/ruby_noexec_wrapper:14:in`'
任务:TOP =&gt;资产:预编译 (通过使用--trace运行任务查看完整跟踪)
这是我的app / assets / javascripts / application.js
//这是一个清单文件,可以编译成application.js,其中包含所有文件 //列在下面。
// //此目录中的任何JavaScript / Coffee文件,lib / assets / javascripts,&gt; vendor / assets / javascripts, //或者插件的vendor / assets / javascripts,如果有的话,可以使用相对的&gt;路径在这里引用。
// //不建议直接在此处添加代码,但如果这样做,它将显示在底部&gt;的左侧 //编译文件。
// //警告:第一条空白线标志着要处理什么的结束,任何空白线应该是什么 //在下面的要求之后去。
// // =需要jquery
// =需要jquery_ujs
// =需要jquery.ui.all
// =要求twitter / bootstrap
// =需要twitter / bootstrap / bootstrap-transition
// =需要twitter / bootstrap / bootstrap-alert
// =需要twitter / bootstrap / bootstrap-modal
// =需要twitter / bootstrap / bootstrap-button
// =需要twitter / bootstrap / bootstrap-collapse
// = require_tree。