dropdown-toggle无法在heroku上运行。不知道为什么

时间:2015-01-16 02:06:35

标签: ruby-on-rails twitter-bootstrap caching heroku asset-pipeline

我遇到一个问题,即下拉菜单和闪存[:通知]没有响应点击。尝试了解决方案Why does dropdown-toggle (bootstrap) not work on heroku?及其他变体。即移动需要自举,但它不起作用。

但是,当我尝试运行rake资产时:在本地和heroku应用程序中重置。耙子被中止,导致不知道如何构建任务'资产:重置'。

然后我在本地给了预编译一个镜头,没有响应,然后我尝试为heroku做这个,并得到下面的错误。

ChickenSmitten:fundspace shengyeong$ heroku run rake assets:reset --app fundspace-session-staging
Running `rake assets:reset` attached to terminal... up, run.4723
rake aborted!
Don't know how to build task 'assets:reset'

(See full trace by running task with --trace)
ChickenSmitten:fundspace shengyeong$ heroku run rake assets:precompile --app fundspace-session-staging
Running `rake assets:precompile` attached to terminal... up, run.6653
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /app/config/environments/staging.rb:23)
I, [2015-01-16T01:54:48.053698 #3]  INFO -- : Writing /app/public/assets/header-bg-cd982ce270a498410ab553c88745e3ed.jpg
rake aborted!
ExecJS::ProgramError: Unexpected token: punc ({) (line: 15915, col: 8, pos: 458835)

Error
    at new JS_Parse_Error (/tmp/execjs20150116-3-vcxs4ojs:2359:10623)
    at js_error (/tmp/execjs20150116-3-vcxs4ojs:2359:10842)
    at croak (/tmp/execjs20150116-3-vcxs4ojs:2359:19086)
    at token_error (/tmp/execjs20150116-3-vcxs4ojs:2359:19223)
    at unexpected (/tmp/execjs20150116-3-vcxs4ojs:2359:19311)
    at semicolon (/tmp/execjs20150116-3-vcxs4ojs:2359:19784)
    at simple_statement (/tmp/execjs20150116-3-vcxs4ojs:2359:22580)
    at /tmp/execjs20150116-3-vcxs4ojs:2359:20553
    at /tmp/execjs20150116-3-vcxs4ojs:2359:19957
    at /tmp/execjs20150116-3-vcxs4ojs:2359:31968
    at Object.parse (/tmp/execjs20150116-3-vcxs4ojs:2360:152)
    at print (/tmp/execjs20150116-3-vcxs4ojs:2632:24)
  (in /app/app/assets/javascripts/application.js)/app/vendor/bundle/ruby/2.0.0/gems/execjs-2.2.2/lib/execjs/external_runtime.rb:64:in `extract_result'
/app/vendor/bundle/ruby/2.0.0/gems/execjs-2.2.2/lib/execjs/external_runtime.rb:29:in `exec'
/app/vendor/bundle/ruby/2.0.0/gems/uglifier-2.6.1/lib/uglifier.rb:200:in `run_uglifyjs'
/app/vendor/bundle/ruby/2.0.0/gems/uglifier-2.6.1/lib/uglifier.rb:178:in `compile'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/uglifier_compressor.rb:25:in `evaluate'
/app/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:197:in `block in evaluate'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `evaluate'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/bundled_asset.rb:25:in `initialize'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `new'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `build_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:211:in `block in find_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:257:in `benchmark'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:210:in `find_asset'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:119:in `block in compile'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `compile'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/rake/sprocketstask.rb:146:in `with_logger'
/app/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
ChickenSmitten:fundspace shengyeong$ rake assets:reset
rake aborted!
Don't know how to build task 'assets:reset'
/Users/shengyeong/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
/Users/shengyeong/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

当我通过这个How can I reset my asset pipeline in Rails?挖掘更多信息时,我意识到这是一个不熟悉的领域。需要建议。

感谢。

1 个答案:

答案 0 :(得分:0)

捆绑exec rake资产:预编译

解决了我的问题。