简体   繁体   English

无法在Eclipse中使用Ant构建Sass文件

[英]Building Sass files in Ant doesn't work from Eclipse

We are migrating the CSS files in our Java webapp over to Sass. 我们正在将Java Webapp中的CSS文件迁移到Sass。 Currently we are using Ant to build our project and we have managed to create a target which will run Sass on our SCSS files. 当前,我们正在使用Ant来构建我们的项目,并且我们设法创建了一个将在我们的SCSS文件上运行Sass的目标。 The target works as expected on OSX through Terminal, on Windows 8 and 8.1 through Command Prompt (when Ruby has been correctly added to PATH), the OSX version of Eclipse and through the Windows version of IntelliJ IDEA when using the Ant Build feature. 当使用Ant Build功能时,目标可以通过终端在OSX上,通过Windows 8和8.1通过命令提示符(在Ruby已正确添加到PATH时),Eclipse的OSX版本以及IntelliJ IDEA的Windows版本上按预期工作。 The problem is that it doesn't work when run through the Windows version of Eclipse. 问题是,当通过Windows版本的Eclipse运行时,它不起作用。 Whenever we try and run an Ant build through Eclipse we get the following error: 每当我们尝试通过Eclipse运行Ant构建时,都会出现以下错误:

[apply] ruby.exe: No such file or directory -- C:/Dev/project/sass (LoadError)

If I change the path of Sass.bat to "C:\\dev\\ruby\\bin\\sass.bat" it works but I would like to avoid this as it means that each developer will need to update their copy of the Ant file to point to their ruby/bin folder. 如果我将Sass.bat的路径更改为“ C:\\ dev \\ ruby​​ \\ bin \\ sass.bat”,则可以使用,但我想避免这种情况,因为这意味着每个开发人员都需要将其Ant文件的副本更新为指向他们的ruby / bin文件夹。

I suspect that there is an extra step in Eclipse that needs to be performed to correctly set up Ant but I'm struggling to work out what the problem is. 我怀疑Eclipse中需要执行一个额外的步骤来正确设置Ant,但是我正在努力找出问题所在。 Thanks! 谢谢!

Had the same problem. 有同样的问题。 I've just added this. 我刚刚添加了这个。 At least its only fixed for windows users. 至少它仅针对Windows用户固定。

<condition property="sass" value="C:/Ruby22/bin/sass.bat" else="sass" >
    <os family="windows" />
</condition>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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