简体   繁体   English

Cygwin:安装指南针后指南针命令不起作用

[英]Cygwin: compass command doesn't work after installing compass

I use cygwin64 on windows. 我在Windows上使用cygwin64。 I have installed compass using the command 我已经使用以下命令安装了指南针

gem install compass

and have got the result: 并得到结果:

Successfully installed compass-1.0.3
Parsing documentation for compass-1.0.3
Done installing documentation for compass after 1 seconds
1 gem installed

But when I try to use the command compass , it says the command doesn't exist. 但是,当我尝试使用命令compass ,它说该命令不存在。

There is a difference in the installation from cygwin compared to when I do it in CMD, where it works. 与cygwin相比,在我可以使用CMD进行安装时,安装有所不同。 If I do 如果我做

gem install compass

from cmd, I get a different kind of installation including 8 gems: 从cmd,我得到了另一种安装方式,其中包括8个gem:

C:\Windows\System32>gem install compass
Fetching: chunky_png-1.3.5.gem (100%)
Successfully installed chunky_png-1.3.5
Fetching: multi_json-1.11.2.gem (100%)
Successfully installed multi_json-1.11.2
Fetching: compass-core-1.0.3.gem (100%)
Successfully installed compass-core-1.0.3
Fetching: compass-import-once-1.0.5.gem (100%)
Successfully installed compass-import-once-1.0.5
Fetching: rb-fsevent-0.9.7.gem (100%)
Successfully installed rb-fsevent-0.9.7
Fetching: ffi-1.9.10-x86-mingw32.gem (100%)
Successfully installed ffi-1.9.10-x86-mingw32
Fetching: rb-inotify-0.9.7.gem (100%)
Successfully installed rb-inotify-0.9.7
Fetching: compass-1.0.3.gem (100%)
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed compass-1.0.3
Parsing documentation for chunky_png-1.3.5
Installing ri documentation for chunky_png-1.3.5
Parsing documentation for multi_json-1.11.2
Installing ri documentation for multi_json-1.11.2
Parsing documentation for compass-core-1.0.3
Installing ri documentation for compass-core-1.0.3
Parsing documentation for compass-import-once-1.0.5
Installing ri documentation for compass-import-once-1.0.5
Parsing documentation for rb-fsevent-0.9.7
Installing ri documentation for rb-fsevent-0.9.7
Parsing documentation for ffi-1.9.10-x86-mingw32
Installing ri documentation for ffi-1.9.10-x86-mingw32
Parsing documentation for rb-inotify-0.9.7
Installing ri documentation for rb-inotify-0.9.7
Parsing documentation for compass-1.0.3
Installing ri documentation for compass-1.0.3
Done installing documentation for chunky_png, multi_json, compass-core, compass-import-once, rb-fsevent, ffi, rb-inotify, compass after 8 seconds
8 gems installed

So , shouldn't this installation be the same for cygwin? 因此,cygwin的安装方式是否应该相同? I see on the compass page on rubygems.org rubygems.org/gems/compass that some "Runtime Dependencies" are listed - so maybe that explains it? 我看到rubygems.org指南针页面上rubygems.org/gems/compass有些“运行时依赖”列-所以也许这可以解释呢? So cygwin doesn't download the dependencies, and I have to do it manually? 因此cygwin不会下载依赖项,我必须手动进行操作吗?

The big question is, why isn't compass available as a cygwin installer package? 最大的问题是,为什么指南针不能作为cygwin安装程序包使用?

By the way, ruby has been installed from the cygwin installer packages, and sass is installed, and working. 顺便说一句,已经从cygwin安装程序包中安装了ruby,并且sass已安装并且可以工作。

There is a compass file in two places: 在两个地方有一个指南针文件:

C:\cygwin64\home\(my username)\bin\compass
C:\cygwin64\home\(my username)\.gem\ruby\gems\compass-1.0.3\bin\compass

but it isn't even looking for this file when I try to run compass command. 但是当我尝试运行compass命令时,它甚至没有在寻找该文件。


Update: 更新:

I installed these gems: chunky_png multi_json compass-core compass-import-once rb-fsevent ffi rb-inotify 我安装了以下这些宝石:chunky_png multi_json罗盘核心罗盘导入一次rb-fsevent ffi rb-inotify

and now when I run compass it looks for the file, but says: 现在,当我运行罗盘时,它会寻找文件,但说:

C:\Ruby22\bin\ruby.exe: No such file or directory -- /cygdrive/c/Ruby22/bin/compass (LoadError)

which is a step in the right direction. 这是朝正确方向迈出的一步。 But it looks for it in the windows installation of ruby, not the cygwin installation. 但是它在ruby的Windows安装而不是cygwin安装中寻找。

this command which -a compass gives: which -a compass给出的此命令:

/cygdrive/c/Ruby22/bin/compass
/cygdrive/c/Ruby22/bin/compass

^this is supposed to be usr\\bin\\gem I think.. ^我认为这应该是usr\\bin\\gem

I had a similar problem. 我有一个类似的问题。 Be careful that you don't get confused between the Ruby instance you may have installed on your Windows and the Cygwin Ruby. 注意不要将您可能已安装在Windows上的Ruby实例与Cygwin Ruby混淆。 You need to add the Ruby bin directory to your PATH. 您需要将Ruby bin目录添加到PATH。 Here's how I did it (after I installed sass with gem): 这是我的操作方法(在用gem安装sass之后):

$ sass
-bash: sass: command not found

$ vi .bashrc

$ tail -2 .bashrc

export PATH=$PATH:/home/luca/bin/

$ source .bashrc

$ sass -v
Sass 3.4.23 (Selective Steve)

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

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