简体   繁体   中英

How to compass compile in rake task

I use rake to prepare files for development.
But I can't compile my sass files with compass

  desc "Compile to compressed css"
  task :compile_compressed do
    #Go to the compass project directory
    Dir.chdir File.join( ENV['base_path'], CONF['dir']['compass'] ) do |dir|
      file_compass_config = "/path/to/some/different/config.rb"

      system "compass compile -c #{file_compass_config} --force"
    end
  end

I'm using rvm with a gemset.

The code from the question actually works.
Probably it was caused beacuse the script was not in he rvm gemset where compass was installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM