2016-03-15 117 views
0

我在Windows上使用cygwin64。我已經使用命令Cygwin:指南針命令在安裝指南針後不起作用

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,它說的命令不存在。

cygwin與我在CMD中進行安裝時的區別在於它的工作原理。如果我做

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上的指南針頁面上看到列出了一些「運行時依賴項」 - 這也許可以解釋它嗎?所以cygwin不下載依賴關係,我必須手動執行它?

最大的問題是,爲什麼沒有指南針作爲cygwin安裝程序包提供?

順便說一下,ruby已經從cygwin安裝程序包安裝,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我想..

+0

如果使用compass命令鍵入路徑,會發生什麼情況?例如。 '/ cygdrive/c/Ruby22/bin/compass <你的標誌或其他什麼>'? –

回答

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)