5

मैं बूटस्ट्रैप-रेल मणि की नवीनतम मास्टर शाखा का उपयोग कर रहा हूं और डिफ़ॉल्ट बूटस्ट्रैप चर को संशोधित करने की कोशिश कर रहा हूं जो कि रेल संपत्ति परिसंपत्ति पाइपलाइन के साथ संगत है।रेल एसेट पाइपलाइन और ट्विटर बूटस्ट्रैप जेम

मेरे मणि फ़ाइल इन जवाहरात शामिल

gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git' 
gem 'uglifier', '>= 1.0.3' 
gem 'less-rails-bootstrap' 

मैं अपने application.css फ़ाइल में *= require bootstrap_and_overrides शामिल है। मुझे पता है कि स्पॉकेट प्रत्येक सीएसएस फ़ाइल को व्यक्तिगत रूप से संकलित करता है और इसलिए आप कई सीएसएस फ़ाइलों को एक दूसरे के संदर्भ में सक्षम होने की उम्मीद नहीं कर सकते हैं।

@import "twitter/bootstrap/bootstrap"; 
body { padding-top: 80px; } 

//background-image: asset-url("background.png"); background-repeat:no-repeat; background-size: cover; } 

@import "twitter/bootstrap/responsive"; 

// Set the correct sprite paths 
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png'); 
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png'); 

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) 
@fontAwesomeEotPath: asset-path('fontawesome-webfont.eot'); 
@fontAwesomeWoffPath: asset-path('fontawesome-webfont.woff'); 
@fontAwesomeTtfPath: asset-path('fontawesome-webfont.ttf'); 
@fontAwesomeSvgzPath: asset-path('fontawesome-webfont.svgz'); 
@fontAwesomeSvgPath: asset-path('fontawesome-webfont.svg'); 

// Font Awesome 
@import "fontawesome"; 

// Your custom LESS stylesheets goes here 
// 
// Since bootstrap was imported above you have access to its mixins which 
// you may use and inherit here 
// 
// If you'd like to override bootstrap's own variables, you can do so here as well 
// See http://twitter.github.com/bootstrap/less.html for their names and documentation 
// 
// Example: 
// @linkColor: #ff0000; 

@navbarHeight: 60px; 
@navbarText: @white; 
@textColor: @orange; 
@navbarLinkColor: @white; 
@navbarBackground: darken(@linkColor, 15%); 
@navbarBackgroundHighlight: @linkColor; 

हालांकि मेरी ओवरराइड में से कोई भी संपत्ति पाइप लाइन के तहत काम: इसलिए bootstrap_and_overrides.css.less फ़ाइल में निम्न शामिल हैं। वे इसके बिना ठीक काम करते हैं। किसी को पता है क्यों?

अद्यतन मेरी संपत्तियों रत्न समूह

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 
    gem 'less-rails' 
    # gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git' 
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    gem 'therubyracer', :platform => :ruby 
    gem 'uglifier', '>= 1.0.3' 
end 
+0

application.css.scss कि आप अपनी संपत्ति समूह में कम-रेल मणि है? – Swift

+0

मैं करता हूं, मेरे मणि संपत्ति समूह –

उत्तर

6

rake assets:precompile चल रहा है स्थानीय स्तर पर पूर्व तैनाती के लिए ऊपर मेरी समस्या हल।

3

मेरे मामले में, निर्देशिका जो संपत्ति पाइपलाइन इंजन संसाधनों के लिए लग रही है ठीक से सेट-अप नहीं किया है, संपत्ति सही तरीके से संकलित नहीं होता है।

मैं बूटस्ट्रैप-एसएएस का उपयोग कर रहा हूं, इसलिए आपकी स्थिति अलग हो सकती है। लेकिन मेरे मामले में, application.rb को निम्नलिखित कोड जोड़कर मेरी समस्या हल हो गई।

module ApplicationModuleName 
    class Application < Rails::Application 

    config.sass.load_paths = [] 
    config.sass.load_paths << "#{Rails.root}/app/assets/stylesheets" 
    %w(bootstrap-sass jstree-rails jquery-rails).each do |pkg| 
     config.sass.load_paths << "#{Gem.loaded_specs[pkg].full_gem_path}/vendor/assets/stylesheets" 
     config.assets.paths << "#{Gem.loaded_specs[pkg].full_gem_path}/vendor/assets/javascripts" 
    end 
    end 
end 

कोशिश रन rails console और इसके बाद के संस्करण को लागू करने (बदसूरत) पैच से पहले या ऐसा load_paths का मूल्य कुछ जाँच ..

+0

के साथ अद्यतन प्रश्न ऊपर दिए गए पैच वैध नहीं हैं क्योंकि 'sass'' config' की विशेषता नहीं है। मुझे ये त्रुटियां मिलती हैं: '/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/railtie/configuration.rb:85:in method_missing: # <रेल के लिए अपरिभाषित विधि sass: : आवेदन :: कॉन्फ़िगरेशन: 0x000000024ace08> (NoMethodError) ' –

+1

मैंने अंतिम पोस्ट पर मॉड्यूल और क्लास रैपर को हटा दिया। उदाहरण सही ढंग से संपादित किया। – shigeya

+0

आपके दृष्टिकोण को साझा करने के लिए धन्यवाद, हालांकि मैंने तैनात करने से पहले स्थानीय रूप से 'रेक संपत्ति: प्रीकंपाइल 'चलाकर अपना मुद्दा हल किया और सबकुछ ठीक हो गया। –

0

मैं रेल 4.1 के साथ कम बूटस्ट्रैप उपयोग कर रहा हूँ और रूबी 2.0 लेकिन मैं जोड़कर इस तय इस

*= require_tree . 
*= require bootstrap_and_overrides 
*= require_self 
संबंधित मुद्दे