昨天想尝试使用 fontawesome,网址为http://fontawesome.io/SASS,我想使用 Ruby Gem 的方法,如下官方截图: 但配置了好久都不成功,请问官网的教程是否有误呢?哎~~~
If you use Rails/Sprockets, add this to e.g. application.css.scss:
*= require font-awesome
这个做了没。
我这里没有看见 application.css.scss,但有 application.css,但我已经加进去了,还是没有 icon 出现,是不是还有什么需要在页面上引用?
用 less 要麻烦一些了,它要 load js runtime,require js 的库 less。把 Gemfile.lock 列出来,看现在用了什么 js runtime。
#14 楼 @Rei 我的 Gemfile.lock 如下:
GEM
remote: http://ruby.taobao.org/
specs:
actionmailer (4.0.1)
actionpack (= 4.0.1)
mail (~> 2.5.4)
actionpack (4.0.1)
activesupport (= 4.0.1)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.1)
activesupport (= 4.0.1)
builder (~> 3.1.0)
activerecord (4.0.1)
activemodel (= 4.0.1)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.1)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.1)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.1)
atomic (1.1.14)
builder (3.1.4)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.3)
commonjs (0.2.7)
erubis (2.7.0)
execjs (2.0.2)
font-awesome-less (4.0.2)
less-rails (>= 2.4.2)
hike (1.2.3)
i18n (0.6.5)
jbuilder (1.5.2)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
less (2.4.0)
commonjs (~> 0.2.7)
less-rails (2.4.2)
actionpack (>= 3.1)
less (~> 2.4.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25)
minitest (4.7.5)
multi_json (1.8.2)
polyglot (0.3.3)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.1)
actionmailer (= 4.0.1)
actionpack (= 4.0.1)
activerecord (= 4.0.1)
activesupport (= 4.0.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.1)
sprockets-rails (~> 2.0.0)
railties (4.0.1)
actionpack (= 4.0.1)
activesupport (= 4.0.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.0)
rdoc (3.12.2)
json (~> 1.4)
sass (3.2.12)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10)
sprockets-rails (~> 2.0.0)
sdoc (0.3.20)
json (>= 1.1.3)
rdoc (~> 3.10)
sprockets (2.10.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (1.3.0)
coffee-rails
tzinfo (0.3.38)
uglifier (2.3.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
PLATFORMS
ruby
DEPENDENCIES
coffee-rails (~> 4.0.0)
font-awesome-less
jbuilder (~> 1.2)
jquery-rails
rails (= 4.0.1)
sass-rails (~> 4.0.0)
sdoc
sqlite3
turbolinks
uglifier (>= 1.3.0)
加
gem 'therubyracer'
https://github.com/cowboyd/commonjs.rb 目前只支持这两个