2015-02-08 39 views
0

我使用Twitter的引導與Ruby on Rails的項目已經添加了相應的寶石等Ruby on Rails的Twitter的引導glyphicons路徑問題

一切都是完美的工作,直到我說的字形圖標 - 按:

<span class="glyphicon glyphicon-user"></span> 

現在我得到這個錯誤:

http://localhost:3000/assets/twitter-bootstrap-static/twitter/fonts/glyphicons-halflings-regular.ttf - HTTP 404. 

我讀了一些關於堆棧溢出這個其他類似的問題,但解決方案不似乎適合我一個pplication。

大多數建議的修復的處理與應用程序/ assetts /樣式表/對於那些有興趣,這是該文件的當前內容bootstrap_and_overrides.css.less:

@import "twitter/bootstrap/bootstrap"; 

// Set the correct sprite paths 
@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png"); 
@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png"); 

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) 
@fontAwesomeEotPath: font-url("fontawesome-webfont.eot"); 
@fontAwesomeEotPath_iefix: font-url("fontawesome-webfont.eot?#iefix"); 
@fontAwesomeWoffPath: font-url("fontawesome-webfont.woff"); 
@fontAwesomeTtfPath: font-url("fontawesome-webfont.ttf"); 
@fontAwesomeSvgPath: font-url("fontawesome-webfont.svg#fontawesomeregular"); 

// Font Awesome 
@import "fontawesome/font-awesome"; 

// Glyphicons 
//@import "twitter/bootstrap/glyphicons.less"; 

// 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/customize.html#variables for their names and documentation 
// 
// Example: 
// @link-color: #ff0000; 

可能在這個文件中的iconspritepath是錯誤的?我不確定它應該是什麼?

請幫忙!

回答

0

我發現了這個問題。它似乎默認情況下在軌道上的紅寶石它設置爲使用fontawesome glyphicons,而不是默認glyphicons bootstrap。

所以我只需要使用,我用這個網站不同的CSS類:

http://fortawesome.github.io/Font-Awesome/icons/

Fontawesome絕對比默認glyphicons所以我現在使用的更好:

<span class="fa fa-users fa-2x"></span> 

爲我的人圖標!