2012-12-28 88 views
2

我很茫然。我使用OS X 10.8.2。無法找到cabal安裝包

我能找到的唯一參考的是:

  • 4.1我剛安裝的軟件包,但現在的包沒有found`

  • 出現這種情況,當你安裝一個全球性的軟件包,以及之前的
    軟件包已在本地安裝。請注意,默認情況下cabal-install在本地默認安裝
    ,並且「runhaskell設置」命令默認安裝
    全局。

陰謀被默認設置爲本地安裝。我沒有改變這一點。 Haskell在全球安裝。

$ cabal install pointfree 
Resolving dependencies... 
Configuring pointfree-1.0.4.3... 
Building pointfree-1.0.4.3... 
Preprocessing executable 'pointfree' for pointfree-1.0.4.3... 
[1 of 7] Compiling Plugin.Pl.Common (Plugin/Pl/Common.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Common.o) 
[2 of 7] Compiling Plugin.Pl.Parser (Plugin/Pl/Parser.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Parser.o) 
[3 of 7] Compiling Plugin.Pl.PrettyPrinter (Plugin/Pl/PrettyPrinter.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/PrettyPrinter.o) 
[4 of 7] Compiling Plugin.Pl.Transform (Plugin/Pl/Transform.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Transform.o) 
[5 of 7] Compiling Plugin.Pl.Rules (Plugin/Pl/Rules.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Rules.o) 
[6 of 7] Compiling Plugin.Pl.Optimize (Plugin/Pl/Optimize.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Optimize.o) 
[7 of 7] Compiling Main    (Main.hs, dist/build/pointfree/pointfree-tmp/Main.o) 
Linking dist/build/pointfree/pointfree ... 
Warning: No documentation was generated as this package does not contain a 
library. Perhaps you want to use the --executables flag. 
Installing executable(s) in 
/Users/beoliver/Library/Haskell/ghc-7.4.2/lib/pointfree-1.0.4.3/bin 
Installed pointfree-1.0.4.3 
Updating documentation index /Users/beoliver/Library/Haskell/doc/index.html 

$ cat ~/.bash_profile 
export PATH="$HOME/Library/Haskell/bin:$PATH" 


$ ls -l ~/Library/Haskell/bin/ 
total 24 
lrwxr-xr-x 1 beoliver staff 49 Dec 28 16:06 cabal -> ../ghc-7.4.2/lib/cabal-install-1.16.0.2/bin/cabal 
lrwxr-xr-x 1 beoliver staff 48 Dec 28 19:52 pointfree -> ../ghc-7.4.2/lib/pointfree-1.0.4.3/bin/pointfree 
-rw-r--r-- 1 beoliver staff 66 Dec 28 19:53 x 

的X是奇數...

$ cat ~/Library/Haskell/bin/x 
(line 1, column 5): 
unexpected "+" 
expecting space or simple term 

我檢查ghc-pkg list但它不存在。所以看看它是否與user包。

$ ls ~/Library/Haskell/ghc-7.4.2/lib/ 
Cabal-1.16.0.3  cabal-install-1.16.0.2 pointfree-1.0.4.3 

$ file pointfree-1.0.4.3/bin/pointfree 
pointfree-1.0.4.3/bin/pointfree: Mach-O 64-bit executable x86_64 

$ ghc-pkg list --user 
/Users/beoliver/.ghc/x86_64-darwin-7.4.2/package.conf.d 
    Cabal-1.16.0.3 
$ cabal --version 
cabal-install version 1.16.0.2 
using version 1.16.0.3 of the Cabal library 

我是否在此處丟失了一面旗幟?我還需要建立它嗎?

$ ghc-pkg check 
Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html/haskell-platform.haddock doesn't exist or isn't a file 
Warning: haddock-html: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html doesn't exist or isn't a directory 
Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/GLUT-2.1.2.1/doc/html/GLUT.haddock doesn't exist or isn't a file 

回答

2

我檢查ghc-pkg list但它不存在。

ghc-pkg只知道和關心已安裝的庫。 pointfree是一個不帶庫的可執行文件,因此ghc-pkg不知道它。

由於$HOME/Library/Haskell/bin在你PATH,並且可執行被鏈接到那裏,你可以簡單地通過命令行

$ pointfree "\f x y -> f y x" 
flip 

(或類似的東西運行它,它是一個很長的時間,因爲我玩pointfree)。

的x是奇...

這看起來像從parsec解析錯誤消息。不過,我不知道可能將哪些內容寫入該文件。

$ ghc-pkg check 
Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html/haskell-platform.haddock doesn't exist or isn't a file 
Warning: haddock-html: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html doesn't exist or isn't a directory 
Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/GLUT-2.1.2.1/doc/html/GLUT.haddock doesn't exist or isn't a file 

東西似乎在踐踏你的鱈魚,或者從一開始就沒有正確安裝。 可能表示一個實際問題,但如果不需要本地文檔,則可以忽略它。

+0

+1。我曾試過$ pointfree/x ...但沒想到把它放在「引號」中!好東西!謝謝。我將繼續並刪除隨機文件。 – beoliver

0

我在~/.cabal/bin/找到了我的cabal軟件包二進制文件。