How do I run sass in ruby?
ruby, sass
Solution
Set the options as you need, then use `Sass::Engine#render`.
require "sass"
options = {
cache: true,
syntax: :sass,
style: :compressed,
filename: original_file_name,
...
}
render = Sass::Engine.new(File.read(original_file_name), options).render
File.write(output_file_name, render)
Problem
How do I call a sass function from inside a ruby file? The following line works in the command prompt: ``` sass C:\Users\..etc..\main.scss ``` I need to put this into a Ruby file. So I wrote as below in a Ruby file: ``` require 'sass' $arg1 = 'C:/Users/dmoores/Desktop/testst/main.scss' sass $arg1 ``` But it complains with the following: ``` undefined method `sass' for main:Object (NoMethodError) ```