ExecJS :: ProgramError:意外字符'#'

时间:2015-02-04 08:22:47

标签: javascript ruby-on-rails ruby

我正在尝试部署到Heroku,我遇到了这个错误。我做了一些研究,并在查看相关帖子后尝试卸载并重新安装一些宝石,但我不确定这里有什么问题,因为我不熟悉实际问题。请帮忙!我该怎么办?到目前为止,我认为它与jquery有关。

ExecJS::ProgramError: Unexpected character '#' (line: 13912, col: 0, pos: 394110)
remote:        Error
remote:        at new JS_Parse_Error (/tmp/execjs20150204-1143-zrnj29js:2359:10623)
remote:        at js_error (/tmp/execjs20150204-1143-zrnj29js:2359:10842)
remote:        at parse_error (/tmp/execjs20150204-1143-zrnj29js:2359:12560)
remote:        at Object.next_token [as input] (/tmp/execjs20150204-1143-zrnj29js:2359:17582)
remote:        at next (/tmp/execjs20150204-1143-zrnj29js:2359:18900)
remote:        at semicolon (/tmp/execjs20150204-1143-zrnj29js:2359:19745)
remote:        at simple_statement (/tmp/execjs20150204-1143-zrnj29js:2359:22580)
remote:        at /tmp/execjs20150204-1143-zrnj29js:2359:20708
remote:        at /tmp/execjs20150204-1143-zrnj29js:2359:19957
remote:        at /tmp/execjs20150204-1143-zrnj29js:2359:31968
remote:        at Object.parse (/tmp/execjs20150204-1143-zrnj29js:2360:152)
remote:        (in /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/app/assets/javascripts/application.js)/tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/execjs-2.2.2/lib/execjs/external_runtime.rb:64:in `extract_result'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/execjs-2.2.2/lib/execjs/external_runtime.rb:29:in `exec'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/uglifier-2.7.0/lib/uglifier.rb:200:in `run_uglifyjs'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/uglifier-2.7.0/lib/uglifier.rb:178:in `compile'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/uglifier_compressor.rb:25:in `evaluate'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:197:in `block in evaluate'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `each'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `evaluate'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/bundled_asset.rb:25:in `initialize'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `new'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `build_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:211:in `block in find_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:257:in `benchmark'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:210:in `find_asset'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:119:in `block in compile'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `each'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `compile'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/rake/sprocketstask.rb:146:in `with_logger'
remote:        /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)

宝石文件     来源'https://rubygems.org'     ruby'2.0.0'

gem 'rails', '4.2.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'bootstrap-sass', '~> 3.3.3' 
gem 'autoprefixer-rails'

group :development, :test do
 gem 'byebug'
 gem 'web-console', '~> 2.0'
 gem 'spring'
 gem 'sqlite3'
end

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

group :doc do
    gem 'sdoc', '~> 0.4.0', require: false
end

/welcome.js

(function($) {
        var $container = $(".parallax");
        var $divs = $container.find("div.parallax-background");
        var thingBeingScrolled = document.body;
        var liHeight = $divs.eq(0).closest("li").height();
        var diffHeight = $divs.eq(0).height() - liHeight;

    var i,len,li,offset,scroll,top;

    var render = function() {
        top = thingBeingScrolled.scrollTop;
        //loop through divs 
        for(i=0,len=$divs.length;i<len;i++) {
                //get one div
                div = $divs[i];

                //get the parent LI
                li = div.parentNode;
                //calculate the offsetTOP of the div
                offset = $(div).offset().top
                //calculate the amount to scroll
                scroll = Math.round(((top - offset)/liHeight) * diffHeight);
                //apply scroll amount
                div.style.webkitTransform = "translate3d(0px,"+scroll+"px,0px)";
        }
    };

    (function loop(){
            requestAnimationFrame(loop);
            render();
        })();

})(jQuery);

1 个答案:

答案 0 :(得分:1)

从任何.js文件中删除以“#”开头的注释行