【发布时间】:2015-11-11 02:47:33
【问题描述】:
我已完成以下步骤来安装 cabal 。我已经使用sudo apt-get install haskell-platform安装了haskell平台
http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html
Building Cabal from git
Assuming you already have a previous version of cabal installed:
$ git clone git://github.com/haskell/cabal.git /path/to/cabal
$ cd /path/to/cabal
$ cabal install Cabal/ cabal-install/
但是,当我尝试初始化沙盒时,它会抛出如下错误。
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal sandbox --help
cabal: unrecognised command: sandbox (try --help)
添加更多细节:
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ which cabal
/home/vagrant/.cabal/bin/cabal
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal --help
This program is the command line interface to the Haskell Cabal infrastructure.
See http://www.haskell.org/cabal/ for more information.
Usage: cabal COMMAND [FLAGS]
or: cabal [GLOBAL FLAGS]
Global flags:
-h --help Show this help text
-V --version Print version information
--numeric-version Print just the version number
Commands:
install Installs a list of packages.
update Updates list of known packages
list List packages matching a search string.
info Display detailed information about a particular package.
fetch Downloads packages for later installation.
unpack Unpacks packages for user inspection.
check Check the package for common mistakes
sdist Generate a source distribution file (.tar.gz).
upload Uploads source packages to Hackage
report Upload build reports to a remote server.
init Interactively create a .cabal file.
configure Prepare to build the package.
build Make this package ready for installation.
copy Copy the files into the install locations.
haddock Generate Haddock HTML documentation.
clean Clean up after a build.
hscolour Generate HsColour colourised code, in HTML format.
register Register this package with the compiler.
test Run the test suite, if any (configure with UserHooks).
bench Run the benchmark, if any (configure with UserHooks).
upgrade (command disabled, use install instead)
help Help about commands
For more information about a command use:
cabal COMMAND --help
To install Cabal packages from hackage use:
cabal install foo [--dry-run]
Occasionally you need to update the list of available packages:
cabal update
You can edit the cabal configuration file to set defaults:
/home/vagrant/.cabal/config
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal COMMAND --help
cabal: unrecognised command: COMMAND (try --help)
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal sandbox --help
cabal: unrecognised command: sandbox (try --help)
【问题讨论】:
-
cabal sandbox仅适用于 cabal-install 1.18 及更高版本。cabal --version告诉你什么? -
我相信 Ubuntu 的软件包系统有一个过时的 haskell 平台(看起来至少过时了几年,非常过时)。我建议从其他来源安装它。
-
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal --version cabal-install 版本 1.16.0.2 使用 Cabal 库 vagrant@vagrant 的版本 1.16.0 -ubuntu-trusty-32:/usr/lib/haskell-packages$ which cabal /home/vagrant/.cabal/bin/cabal
-
@DavidYoung:我添加了更多细节。检查
-
@Zack 好吧,就像我说的,我建议从更新的来源获取 haskell-platform/ghc。该安装可能充其量只有 GHC 7.6.3,它是最新稳定版本之后的两个(很快将是三个)主要版本(并且功能数量存在很大差异。您可能会遇到很多不兼容问题与 Haskell 库)。不过,您可以通过升级 cabal 来解决这个特定问题(虽然这不会升级 GHC 编译器)。这可以通过
cabal update && cabal install cabal-install完成。
标签: haskell cabal cabal-install