我试着安装了threepenny-gui,可能在安装过程中弄坏了一些东西。我的问题是(1)我如何解决这个问题,以及(2)当cabal发出关于可能重新安装的警告时,应该如何处理?
threepenny-gui警告我,它可能会破坏regex-compat:
jeffreys-mbp:~ jbb$ cabal install threepenny-gui -fbuildExamples
cabal: The following packages are likely to be broken by the reinstalls:
regex-compat-0.95.1
Use --force-reinstalls if you want to install anyway.我还没有在haskell中使用正则表达式,所以这似乎是值得冒险的,所以我继续:
jeffreys-mbp:~ jbb$ cabal install threepenny-gui -fbuildExamples --force-reinstalls它启动了一个发出以下警告的进程:
Warning: The following packages are likely to be broken by the reinstalls:
regex-compat-0.95.1但除此之外似乎还行得通。然后,我尝试运行了几个示例程序,但没有成功:
jefferys-mbp:samples jbb$ ./runhaskell Chat.hs
ghc: can't find a package database at ../.cabal-sandbox/*-packages.conf.d
jefferys-mbp:samples jbb$ ./runhaskell MissingDollars.hs
ghc: can't find a package database at ../.cabal-sandbox/*-packages.conf.d
jefferys-mbp:samples jbb$我在谷歌上搜索了这个错误,找到了only one page with it,我不知道如何使用它。
我认为问题可能是我破坏了regex-compat,所以我尝试重新安装它:
jefferys-mbp:samples jbb$ cabal install regex-compat
Resolving dependencies...
All the requested packages are already installed:
regex-compat-0.95.1
Use --reinstall if you want to reinstall anyway.
jefferys-mbp:samples jbb$ cabal install regex-compat --reinstall
Resolving dependencies...
In order, the following will be installed:
regex-compat-0.95.1 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
## It warned me that its suggestion is dangerous only AFTER I had acted on its suggestion.
Downloading regex-compat-0.95.1...
Configuring regex-compat-0.95.1...
Building regex-compat-0.95.1...
Installed regex-compat-0.95.1
Updating documentation index /Users/jbb/Library/Haskell/share/doc/index.html
jefferys-mbp:samples jbb$ 我不知道是不是重新安装了regex-compat,但threepenny-gui中的示例仍然不能为我运行。
我在2011年初的MBP上运行OS X Mavericks。在threepenny之前,我尝试安装wxWidgets和GTK,这两个似乎都成功了,但也不让我运行示例代码。这让我考虑再买一台电脑,改用Linux。(我也没能在这台机器上安装Linux。)
发布于 2014-11-30 19:10:20
使用-fbuildExamples选项安装threepenny-gui包(编写本文时的版本0.5.* )将使示例成为可执行文件。例如,可以通过键入以下命令来运行聊天示例
$ threepenny-examples-chat您也可以直接运行samples/文件夹中的示例,但这对库开发人员来说更方便。您不必使用runhaskell和ghci脚本;它们设置了一些路径,但它们还假定您已经在源代码树的根目录中设置了一个cabal沙箱,并安装了依赖项。
您自己编写或从其他地方复制的示例代码应该运行得很好。
发布于 2014-11-30 18:26:35
使用以下方法在沙箱中构建它:
cabal sandbox init
cabal install --only-dependencies
cabal install生成的可执行文件将驻留在.cabal-sandbox/bin中
有关cabal沙箱的更多信息,请访问here
你的问题与错综复杂的依赖关系有关,而不是OSX。
https://stackoverflow.com/questions/27211978
复制相似问题