私はRails 3.1アプリを本番環境に導入する準備ができています。アセットパイプラインを使用しているので、I need to precompile my assetsです。私はこれを試してみてくださいしかし、私は明らかにjQueryのコンパイルに関連するエラーが表示されます。bundle exec rake assets:予期しないトークンでプリコンパイルが失敗する
$ bundle exec rake --trace assets:precompile
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/adam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /home/adam/.rvm/gems/[email protected]/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
399: unexpected token at '"/*!\u000a * jQuery JavaScript Library v1.7.1\u000a * http://jquery.com/\u000a *\u000a * Copyright 2011, John Resig\u000a * Dual licensed under the MIT or GPL Version 2 licenses.\u000a * http://jquery.org/license\u000a *\u000a * Includes Sizzle.js\u000a * http://sizzlejs.com/\u000a * Copyright 2011, The Dojo Foundation\u000a * Released under the MIT, BSD, and GPL Licenses.\u000a *\u000a * Date: Mon Nov 21 21:11:03 2011 -0500\u000a */\u000afunction addActiveScaffoldPageToHistory(a,b){if(typeof
[原料の多くを切り取る]
(in /data/music/RotC/eventbook/app/assets/javascripts/application.js)
/home/adam/.rvm/gems/ruby-[email protected]/gems/json-1.6.4/lib/json/common.rb:148:in `parse'
/home/adam/.rvm/gems/[email protected]/gems/json-1.6.4/lib/json/common.rb:148:in `parse'
/home/adam/.rvm/gems/[email protected]/gems/multi_json-1.0.4/lib/multi_json/engines/json_common.rb:9:in `decode'
/home/adam/.rvm/gems/[email protected]/gems/multi_json-1.0.4/lib/multi_json.rb:76:in `decode'
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:61:in `extract_result'
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:27:in `block in exec'
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:40:in `compile_to_tempfile'
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:26:in `exec'
[たくさんの、より多くのものを中略]
ここに私のapplication.js
です:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//
// N.B. jQuery requires have to come before this:
//= require active_scaffold
私はuglifier
つまり、デフォルトのコンプレッサーを使用しています。
私はconfig/environments/production.rb
にfalse
にconfig.assets.compress
を変更した場合、それが正常に動作することを発見しましたが、私はtrue
としてそれを維持する方法を見つけ出すことができれば、もちろん私のアプリは、パフォーマンスが向上します。
私はrake assets:precompile doesn't work (rails 3.1.1)を見ましたが、エラーはundefined: Unexpected token: operator (<)
であるため重複しているとは思われません。
アイデア? jQueryコードのユニコード文字は漠然と疑わしいですが、問題を引き起こしていることを証明するかどうかはわかりません。
どのコンプレッサーを使用していますか?あなたのapplication.jsには何がありますか? –
質問が更新されました。 –