在Windows上配置指南针 [英] Configuring Compass on Windows
问题描述
我在Windows上,我的项目中已经成功运行SASS。现在,我想包括指南针,以便我可以利用预先编写的mixins等。
I'm on Windows, and I have SASS running successfully in my project. Now, I want to include compass so I can take advantage of the pre-written mixins, etc.
首先,我只是从我的工作sass文件中尝试这个语句: code> @importcompass / css3 / transform;
First I simply tried this statement from within my working sass file: @import "compass/css3/transform";
当然,这没有工作,因为我没有罗盘安装,所以我导航到我的Ruby目录,并成功安装指南针gem在 c:/ ruby193 / bin
。我现在可以在 c:/ ruby193 / bin
中成功创建指南针项目,但这不会对我有好处。
Naturally, this didn't work since I didn't have compass installed, so I navigated to my Ruby directory and successfully installed the compass gem within c:/ruby193/bin
. I can now successfully create compass projects within c:/ruby193/bin
, but that doesn't do me much good.
我需要在我的网站中运行指南针命令,它居住在这里: c:/ inetpub / mysite
。但是,当我尝试这样做时,我得到指南针不被识别为内部或外部命令
I need run compass commands within my site, which lives here: c:/inetpub/mysite
. When I try to do so, however, I get compass is not recognized as internal or external command
如何
EDIT :我的问题很大一部分是Ruby安装时没有添加到Windows路径环境变量,所以我只能从C:/ Ruby193 / bin目录中运行SASS和Compass命令。这导致我的问题,因为,因此,我认为这是我需要安装指南针。无论如何,在搞清楚了,我还是没能得到指南针工作,但我计划取消索要SASS,指南针和Ruby,并给这个东西从头开始另一个尝试。我标记Stooboo的答案是正确的,因为它是最好的,最准确的,尤其是考虑到他必须与之合作的信息。谢谢!
推荐答案
这是我的操作
(一次)
-
安装ruby http:/ /rubyinstaller.org/
安装指南针,在命令窗口中输入
install compass, in a command window enter
gem install compass
项目,导航到项目文件夹并在命令窗口中输入
to add compass to an MVC project, navigate to project folder and in a command window enter
compass create
你会得到默认的config.rb ...但这里是我平常的
you will get the default config.rb ... but here is my usual one
http_path = "/"
css_dir = "content/css"
sass_dir = "content/sass"
images_dir = "images"
javascripts_dir = "scripts"
安装引导程序(更多信息参见https://github.com/thomas-mcdonald/bootstrap-sass )
add
to install bootstrap (for more info see https://github.com/thomas-mcdonald/bootstrap-sass) add
require 'bootstrap-sass'
您的config.rb
to your config.rb
输入(在命令窗口中)
gem install bootstrap-sass
(我必须在命令窗口中输入
gem更新
之后,但您可能不需要)
(I had to do a (in your command window) gem update after this but you may not need to)
输入(在命令窗口中)
compass install bootstrap
(每次在Visual Studio中打开解决方案)
(then ... every time you open the solution in Visual Studio)
- 导航到项目文件夹
-
在命令窗口中输入
- navigate to project folder
in a command window enter
compass watch
(这将监视项目的保存和重新编译scss文件)
(this will monitor project for saves and re-compile the scss files)
希望有助于
干杯
Stu
Cheers Stu
这篇关于在Windows上配置指南针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!