2015-06-19 4 views
9

घटनाक्रम में (4.2 एप्लिकेशन रेल), हम precompile निम्न आदेश के साथ स्थानीय संपत्ति कर रहे हैं:रेल 4 - स्थानीय संपत्ति precompile त्रुटि

$ RAILS_ENV=production bundle exec rake assets:clean assets:precompile RAILS_RELATIVE_URL_ROOT=/tj --trace 
** Invoke assets:clean (first_time) 
** Invoke assets:environment (first_time) 
** Execute assets:environment 
** Invoke environment (first_time) 
** Execute environment 
** Execute assets:clean 
** Invoke assets:precompile (first_time) 
** Invoke assets:environment 
** Execute assets:precompile 
rake aborted! 
Sass::SyntaxError: Invalid CSS after "...ontent}*/ url(C": expected comma, was ":/Program Files..." 
(sass):66 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:1162:in `expected' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/lexer.rb:221:in `expected!' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:463:in `block in arglist' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:460:in `loop' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:460:in `arglist' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:445:in `fn_arglist' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:407:in `funcall' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:387:in `ident' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:246:in `unary_not' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:246:in `unary_div' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:246:in `unary_minus' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:246:in `unary_plus' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:227:in `times_div_or_mod' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:227:in `plus_or_minus' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:227:in `relational' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:227:in `eq_or_neq' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:227:in `and_expr' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:227:in `or_expr' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:364:in `space' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:345:in `interpolation' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:293:in `expr' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:571:in `assert_expr' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/script/parser.rb:62:in `parse' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:1024:in `sass_script' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:877:in `value!' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:750:in `block in try_declaration' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:1138:in `call' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:1138:in `rethrow' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:763:in `try_declaration' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:693:in `declaration_or_ruleset' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:658:in `block_child' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:650:in `block_contents' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:639:in `block' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:632:in `ruleset' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:657:in `block_child' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:650:in `block_contents' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:117:in `stylesheet' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/scss/parser.rb:42:in `parse' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/engine.rb:393:in `_to_tree' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.4.14/lib/sass/engine.rb:268:in `render' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/sass_compressor.rb:48:in `call' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/sass_compressor.rb:28:in `call' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/processor_utils.rb:75:in `call_processor' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/processor_utils.rb:56:in `reverse_each' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/processor_utils.rb:56:in `call_processors' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/loader.rb:86:in `load_asset_by_uri' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/loader.rb:45:in `block in load' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/loader.rb:155:in `fetch_asset_from_dependency_cache' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/loader.rb:38:in `load' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/cached_environment.rb:20:in `block in initialize' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/cached_environment.rb:47:in `yield' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/cached_environment.rb:47:in `load' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/base.rb:63:in `find_asset' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/base.rb:70:in `find_all_linked_assets' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/manifest.rb:138:in `block in find' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:223:in `block in stat_tree' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:207:in `block in stat_directory' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:204:in `each' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:204:in `stat_directory' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:222:in `stat_tree' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:226:in `block in stat_tree' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:207:in `block in stat_directory' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:204:in `each' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:204:in `stat_directory' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/path_utils.rb:222:in `stat_tree' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/legacy.rb:105:in `each' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/legacy.rb:105:in `block in logical_paths' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/legacy.rb:104:in `each' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/legacy.rb:104:in `logical_paths' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/manifest.rb:136:in `find' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/sprockets/manifest.rb:162:in `compile' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-3.2.0/lib/rake/sprocketstask.rb:147:in `with_logger' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain' 
c:/Ruby200/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run' 
c:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>' 
c:/Ruby200/bin/rake:23:in `load' 
c:/Ruby200/bin/rake:23:in `<main>' 
Tasks: TOP => assets:precompile 

त्रुटि सास में parser.rb में कारण होता है। हम समझ में नहीं आता कि त्रुटि का मतलब क्या है। हमने उत्पादन सर्वर पर तैनाती करने की कोशिश की और उपर्युक्त संपत्ति प्रीकंपाइल कमांड बिना किसी त्रुटि के सफलतापूर्वक भाग गया। क्या कोई हमें त्रुटि और/या ठीक करने में मदद कर सकता है?

+1

इसका मतलब है कि आपके पास आपकी एसएएस फाइलों में कहीं भी अमान्य वाक्यविन्यास है –

+0

सही, हम कहां खोजने की कोशिश कर रहे हैं। और चूंकि विकास और लाइव संकलन में कोई त्रुटि नहीं है, इसलिए हम यह जानना चाहते हैं कि त्रुटि सार्थक है या नहीं। – user938363

+0

और उत्पादन सर्वर पर प्रीकंपाइल संपत्तियों में कोई त्रुटि नहीं है। – user938363

उत्तर

1

अपनी SASS फ़ाइल की लाइन 66 चेक करें।

Sass::SyntaxError: Invalid CSS after "...ontent}*/ url(C": expected comma, was  
":/Program Files..."(sass):66 

एक अवैध सीएसएस त्रुटि की तरह दिखता है। मुझे लगता है कि आप बाहरी फाइल से लिंक करने का प्रयास कर रहे हैं? आपको पथों की जांच करनी होगी।

शायद 'सी:/प्रोग्राम फ़ाइलें ...' का उपयोग नहीं कर सकते हैं, बजाय संबंध में एक relative path के लिए इसे बदल अपनी फ़ाइलें अर्थात को

url(../../external_directory/image.png) 
+0

हमें सीएसएस फ़ाइल में 'सी:/प्रोग्राम फ़ाइलें ..' नहीं मिला। हमें संदेह है कि यह मणि स्प्राकेट्स – user938363

3

सुनिश्चित करें कि आपके सीएसएस फ़ाइलें वाक्य रचना सही और ठीक से दांतेदार है । या आप मणि फ़ाइल से अपने सास मणि की स्थापना रद्द कर सकते हैं ... लेकिन यह एक अच्छा समाधान .. अपने सीएसएस वाक्य रचना को दूर करने के कोशिश नहीं है ..

+0

के असंगत संस्करण के कारण झूठा अलार्म है, हमने फिर से वाक्यविन्यास की जांच की और त्रुटि नहीं मिली। हमें संदेह है कि यह मणि sprockets के असंगत संस्करण के कारण झूठा अलार्म है। – user938363

1

sprockets' from 3.2.0 to 2.12.3 , the error disappeared. The error seems to be caused by incompatible version of के संस्करण वापस रोलिंग के बाद sprockets` जो रेल के लिए संपत्ति precompile करता है। जब निम्नलिखित कोड का सामना

0

सास प्रोसेसर (सास मणि में स्थित) में सिंटेक्स त्रुटि फेंक है:

ontent}*/ url(C:/Program 

जो कोड संपत्ति पाइप लाइन द्वारा उत्पन्न होता है जब अपने स्थानीय मणि संपत्ति में से एक precompiling (सबसे संभावना jQuery-ui-रेल मणि, फ़ाइल jQuery-ui-रेल-xxx \ एप्लिकेशन \ संपत्ति \ javascripts \ jQuery ui को \ theme.css.erb, निम्न पंक्ति):

background: #ffffff/*{bgColorContent}*/ url(<%= image_path("jquery-ui/ui-bg_flat_75_ffffff_40x100.png") %>) 

आप के लिए की जरूरत है सटीक त्रुटि स्थान को स्पॉट करें जिसे आप अस्थायी रूप से निम्न पंक्ति पर टिप्पणी कर सकते हैं:

was = was[0...15] + "..." if was.size > 18 
सास मणि में

, सास-x.x.x \ lib \ सास \ एससीएसएस \ parser.rb फ़ाइल, डीईएफ़ self.expected (स्कैनर, उम्मीद, लाइन) विधि।

image_path सहायक विधि config.relative_url_root में गलत मान के कारण संपत्ति के सही पथ का उपयोग नहीं कर रहा है (relative_url_root को बहिष्कृत किया गया है, लेकिन अभी भी image_path द्वारा उपयोग किया जाता है)। जब precompiling http://apidock.com/rails/ActionView/Helpers/AssetUrlHelper/asset_path

अन्य Rails.application.config.action_controller.relative_url_root (ckeditor_rails की तरह) का उपयोग कर जवाहरात एक ही मुद्दों पैदा कर रहे हैं।

RAILS_RELATIVE_URL_ROOT पैरामीटर के साथ प्रीकंपाइल कार्य (या रेल कंसोल) चलाते समय समस्या उत्पन्न हो रही है। भागो

RAILS_RELATIVE_URL_ROOT /yourapprelativeurl rails c 

और आप के साथ गलत पथ देखेंगे:

p Rails.application.config.action_controller.relative_url_root 

एक वैकल्पिक हल आवेदन में स्थापित करने के लिए है।आरबी:

config.action_controller.relative_url_root = "" #or "yourapprelativeurl" 

यह रत्न संपत्तियों को प्रीकंपाइल करेगा, लेकिन इसमें अन्य अप्रत्याशित परिणाम भी हो सकते हैं।

संबंधित मुद्दे