How can I get Assetic to compile SCSS on Zend Framework on Windows?

风流意气都作罢 提交于 2019-12-01 14:20:16

I think I got it working, but I'm not 100% sure I could reproduce the steps to fix it.

So please add a new answer if you figure out better details.

I have Ruby installed at C:\Ruby193\. I needed to edit the sass.bat file in its 'bin' folder to be:

@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:/Ruby193/bin/sass" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"C:/Ruby193/bin/ruby.exe" "%~dpn0" %*

I read https://github.com/symfony/AsseticBundle/issues/81.

I replaced the file at C:\wamp\bin\php\php5.3.10\PEAR\pear\Symfony\Component\Process\Process.php with https://raw.github.com/symfony/Process/master/Process.php.

I don't know whether this matters, but Assetic was using forward slashes instead of the PHP constant called DIRECTORY_SEPARATOR, so:

In Assetic\Filter\Sass\SassFilter.php, I added $root = str_replace('/', DIRECTORY_SEPARATOR, $root);//fix for Windows after $root = $asset->getSourceRoot();

And slightly below that, I changed a line to $pb->add('--load-path')->add(dirname($root.DIRECTORY_SEPARATOR.$path));.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!