2013-03-16 17 views
2

我有一個Rails應用程序,我試圖導入引導在Heroku上與引導,青菜從這裏開始的方向如下:https://github.com/thomas-mcdonald/bootstrap-sass嘗試通過引導,薩斯導入引導在Heroku,但得到一個錯誤

在我application.css ,我有:

@import "bootstrap"; 
/* 
* This is a manifest file that'll be compiled into application.css, which will include all the files 
* listed below. 
* 
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 
* 
* 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. 
* 
*/ 

@import "overrides.css.scss"; 

但我得到以下錯誤,當我git push heroku master

-----> Preparing app for Rails asset pipeline 
     Running: rake assets:precompile 
     rake aborted! 
     File to import not found or unreadable: bootstrap. 
     Load path: /tmp/build_8elam02dzb95 
     (in /tmp/build_8elam02dzb95/app/assets/stylesheets/application.css) 
     (sass):1 
     /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:67:in `rescue in import' 
     /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:45:in `import' 
     /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:28:in `imported_file' 
     /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/import_node.rb:37:in `css_import?' 
     /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/visitors/perform.rb:217:in `visit_import' 
     /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/visitors/base.rb:37:in `visit' 
     /tmp/build_8elam02dzb95/vendor/bundle/ruby/1.9.1/gems/sass-3.2.7/lib/sass/tree/visitors/perform.rb:100:in `visit' 

我在做什麼錯?

編輯#1 輸出,顯示引導,薩斯安裝

-----> Ruby/Rails app detected 
-----> Installing dependencies using Bundler version 1.3.2 
     Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment 
     Using rake (10.0.3) 
     Using i18n (0.6.4) 
     Using multi_json (1.6.1) 

     .... 
     Using sass (3.2.7) 
     Using bootstrap-sass (2.2.2.0) 
     Using coffee-script-source (1.6.1) 
+0

是你的gemfile中的bootstrap-sass gem?你能證實Heroku正在安裝嗎? – drewinglis 2013-03-16 04:15:23

+0

添加了顯示安裝的heroku輸出,並且可以確認從heroku控制檯進行創建列表 – timpone 2013-03-16 04:39:16

+0

'/ * = require bootstrap * /'怎麼辦? – juanpastas 2013-03-16 04:41:59

回答

1

這已經有一段時間,所以不知道這仍然是相關的。看起來你的application.css應該被命名爲application.css.scss,這樣它就會被Sass處理。否則,正常的CSS @import指令不會知道Sass Bootstrap。

0

我寧願建議不要重命名application.css而是創建一個新的文件名爲custom.css.scss和與

@import「引導」;

那裏。另外請確保您的gemfile中有sass-rails寶石。
以上配置對我來說工作正常。和我的application.css看起來像這樣:

* 
*= require_self 
*= require_tree . 
*/ 
相關問題