के साथ विफल रहता है, मैं अपने रेल 3.1 ऐप को उत्पादन में तैनात करने के लिए तैयार हूं, और चूंकि मैं संपत्ति पाइपलाइन, I need to precompile my 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/[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
है: हालांकि, जब मैं यह कोशिश, मैं जाहिरा तौर पर jQuery संकलन से संबंधित कोई त्रुटि मिलती है :
//= 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 कोड में उन यूनिकोड वर्णों के बारे में बेहद संदिग्ध हूं, लेकिन मुझे यकीन नहीं है कि वे कैसे साबित या अस्वीकार कर रहे हैं कि वे समस्या पैदा कर रहे हैं।
जब आप अपने रेल में एक या अधिक जावास्क्रिप्ट फ़ाइलें 3.1 application.js और //= require ...
का उपयोग कर पर्यावरण में शामिल हैं, रेल सामग्री लपेट होगा:
जो जेएस कंप्रेसर आप उपयोग कर रहे हैं? आपके application.js में क्या है? –
प्रश्न अब इनके साथ अपडेट किया गया है। –