मैंने एक नया नया रेल 3.1 ऐप बनाया है। मैंने ऐप/संपत्ति/स्टाइलशीट/bootstrap.min.css में ट्विटर बूटस्ट्रैप सीएसएस फ़ाइल जोड़ा। (ताकि बूटस्ट्रैप शामिल किया गया है, पेड़ भी शामिल है) यहाँ प्रासंगिक कोडट्विटर बूटस्ट्रैप में प्रीकंपिलेशन के दौरान रेल 3.1 संपत्ति पाइपलाइन के अनुसार अमान्य सीएसएस है?
एप्लिकेशन/आस्तियों/स्टाइलशीट/application.css है
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/
Gemfile
group :development, :qa do
gem 'execjs'
gem 'therubyracer'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier', '>= 1.0.3'
end
(संकलन/संपीड़ित के लिए execjs और therubyracer भी शामिल है)
तब मैं संपत्ति
rake assets:precompile
इस च precompile करने के लिए रेक कार्य चलाने निम्न त्रुटि
Invalid CSS after ".inputs-list li+": expected number or function, was "li"
कि सीएसएस बूटस्ट्रैप फ़ाइल में है के साथ बीमारी (".inputs-सूची ली + ली" चयनकर्ता है)।
हालांकि, अगर मैं
rake assets:precompile RAILS_ENV=development
चलाने अब यह ठीक काम करता है। पता चला है कि अगर मैं config/वातावरण/production.rb बदलने फ़ाइलों को संपीड़ित नहीं करने के लिए:
config.assets.compress = false
तो मूल आदेश भी काम करता है (विकास पर्यावरण निर्दिष्ट किए बिना)।
तो, मैं त्रुटि को कैसे ट्रैक करूं? मैं अभी के लिए संपीड़न बंद करने के साथ रह सकता हूं, लेकिन जाहिर है कि कुछ गलत है। क्या यह रेल है? Sprockets? रुबी रेसर? Uglifier?
मैंने सोचा कि मैं के साथ-साथ गैर न्यूनतम किया संस्करण की कोशिश की है - और यह अभी भी काम नहीं किया गया था। अगर मैं वास्तव में कोशिश करना भूल गया तो मैं आपका जवाब स्वीकार करूंगा। किसी भी मामले में, मैंने आज रेलवे 3.1.1 ऐप पर फिर कोशिश की, और यह ठीक काम किया। दोनों minified और गैर-minified verions के साथ। – davekaro
रेल को 3.1.1 में यह जानना अच्छा लगता है कि यह ठीक काम करता है :) – Ian