HTML/CSS 如何在 Rails 4 项目中使用 Compass

u1375863851 · August 23, 2013 · Last by u1375863851 replied at August 25, 2013 · 3484 hits

有在 rails4 中使用 compass 的兄弟吗?

# 1st, In Gemfile:
gem 'compass-rails'

# 2nd, In CLI:
$ compass init rails

楼上别试都没试张口就来啊…… compass-rails 还没发正式支持 rails4 的版本,这样装 assets:precompile 过不了的 目前能用的方法大概是 gem 'compass-rails', github: 'milgner/compass-rails', ref: '1749c06f15dc4b058427e7969810457213647fb8'

#2 楼 @aptx4869 嗯,我的确没试过,也没注意 LZ 要求 Rails4,抱歉了。

我先在 Gemfile 添加了一个

group :assets do
  gem "compass-rails", "~> 2.0.alpha.0"
end

跑过了 compass init rails ~/path/to/your/app, 把 gem "compass-rails", "~> 2.0.alpha.0"这一行移出来,然后把 group assets删掉,最后我试了 precompile,发现是 ok 的。 https://github.com/chriseppstein/compass/issues/823#issuecomment-21940498

You need to Sign in before reply, if you don't have an account, please Sign up first.