Rails 3.0.9。無法使指南針+警衛+ sass工作
在Gemfile中:
gem 'compass-rails' (1.0.1)
gem 'sass' (3.0.19)
...
group :development, :test do
gem 'guard' (1.0.3)
gem 'guard-sass' (0.6.0)
...
end
在此配置中的錯誤是:
ERROR: Sass > Syntax error: File to import not found or unreadable: compass.
Load paths:
/var/www/inbox/public
/var/www/inbox/public/images
/var/www/inbox/public/images/intro
...
(一般我可以看到,路徑羅盤缺失(即...ruby-1.9.3-p194-perf/gems/compass-0.12.1/frameworks/compass/stylesheets
是不那裏),所以不知何故指南針沒有被加載,我不知道該如何做才能加載。
當我交易guard-sass
爲guard-compass
錯誤是:
ERROR: Rails.root is nil! (RuntimeError)
/home/jkl/.rvm/gems/ruby-1.9.3-p194-perf/gems/sass-3.1.19/lib/sass/util.rb:370:in `rails_root'
/home/jkl/.rvm/gems/ruby-1.9.3-p194-perf/gems/sass-3.1.19/lib/sass/plugin/rails.rb:11:in `default_options'
/home/jkl/.rvm/gems/ruby-1.9.3-p194-perf/gems/sass-3.1.19/lib/sass/plugin/configuration.rb:33:in `options'
/home/jkl/.rvm/gems/ruby-1.9.3-p194-perf/gems/sass-3.1.19/lib/sass/plugin/compiler.rb:38:in `initialize'
/home/jkl/.rvm/gems/ruby-1.9.3-p194-perf/gems/sass-3.1.19/lib/sass/plugin.rb:63:in `new'
/home/jkl/.rvm/gems/ruby-1.9.3-p194-perf/gems/sass-3.1.19/lib/sass/plugin.rb:63:in `compiler'
/home/jkl/.rvm/gems/ruby-1.9.3-p194-perf/gems/sass-3.1.19/lib/sass/plugin.rb:120:in `options'
...
我想這對於guard-livereload
每當我更新.sass
文件才能正常工作。
請注意,通常指南針正常工作。頁面刷新後,將從SASS文件生成新的CSS。
嘗試用'bundle exec'或使用我的gem'rubygems-bundler'作爲前綴? – mpapis
我正在運行一個zsh插件,它爲每個rake/guard/etc添加前綴。如果找到Gemfile,則命令爲「bundle exec」(https://github.com/pjg/dotfiles/blob/master/.zsh/bundler/bundler.plugin.zsh)。所以這裏沒有捆綁器問題:)我認爲這是某種訂購問題,即guard-sass在compass-rails有加載的機會之前加載。 –