Cygwin:罗盘命令在安装罗盘后不起作用

时间:2016-03-15 22:55:22

标签: ruby windows rubygems cygwin compass

我在windows上使用cygwin64。我已经使用命令

安装了指南针
gem install compass

并得到了结果:

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

但是当我尝试使用命令compass时,它说该命令不存在。

与我在CMD中进行安装时相比,cygwin的安装有所不同。如果我做

gem install compass

来自cmd,我得到了另外一种安装,包括8个宝石:

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

那么,对于cygwin,这个安装是否应该是相同的? 我在rubygems.org rubygems.org/gems/compass的罗盘页面上看到 一些"运行时依赖"被列出 - 所以也许这解释了吗?所以cygwin没有下载依赖项,我必须手动完成它?

最大的问题是,为什么没有指南针作为cygwin安装程序包提供?

顺便说一下,已经从cygwin安装程序包中安装了ruby,并安装了sass并正常工作。

在两个地方有一个指南针文件:

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

但是当我尝试运行compass命令时,它甚至不会查找此文件。

更新

我安装了这些宝石: chunky_png multi_json 指南针核心 一次指南针进口 RB-fsevent FFI RB-inotify的

现在当我运行罗盘时它会查找文件,但是说:

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

这是朝着正确方向迈出的一步。但它在ruby的windows安装中寻找它,而不是cygwin安装。

此命令which -a compass给出:

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

^这应该是usr\bin\gem我认为..

1 个答案:

答案 0 :(得分:0)

我有类似的问题。请注意,不要在Windows上安装的Ruby实例和Cygwin Ruby之间混淆。您需要将Ruby bin目录添加到PATH中。这就是我如何做到的(在我用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)