2013-04-01 02:16:06 +04:00
|
|
|
# Installation Guide
|
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
hledger works on GNU/linux, mac and windows.
|
|
|
|
Here are several ways to install it.
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
## Install with your system package manager
|
|
|
|
|
|
|
|
If you have a system package manager that includes hledger,
|
|
|
|
this will be the quickest and easiest way to install,
|
|
|
|
if you don't need the very latest version.
|
|
|
|
|
|
|
|
Debian, Ubuntu: `apt-get install hledger [hledger-web]`
|
|
|
|
|
|
|
|
Red Hat, Fedora: `yum install hledger`
|
2013-04-01 02:16:06 +04:00
|
|
|
|
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
## Install binaries from hledger.org
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 20:02:20 +04:00
|
|
|
[Ready-to-run binaries](DOWNLOAD.html) for GNU/Linux, Mac OSX, and Microsoft Windows can be downloaded from this site.
|
|
|
|
They are out of date, but you can fund new ones with a donation of any size (see the page for more).
|
|
|
|
This is probably the easiest way to install hledger on windows and mac.
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 20:02:20 +04:00
|
|
|
The binaries do not currently include installers, so after downloading
|
|
|
|
you may need to decompress, make executable, and/or rename the file. Eg:
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
$ gunzip hledger-web-0.18.2-mac-x86_64.gz
|
|
|
|
$ chmod +x hledger-web-0.18.2-mac-x86_64
|
|
|
|
$ mv hledger-web-0.18.2-mac-x86_64 /usr/local/bin/hledger-web
|
|
|
|
$ /usr/local/bin/hledger-web --version
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
## Install from hackage with cabal
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
You can download and build the latest release yourself using cabal, the standard installer for Haskell software.
|
|
|
|
This is the most common way to install hledger, but not always the easiest;
|
|
|
|
use the troubleshooting tips below if needed.
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
Ensure you have [GHC](http://hackage.haskell.org/ghc/) or
|
2013-04-19 23:41:42 +04:00
|
|
|
the [Haskell Platform](http://hackage.haskell.org/platform/) installed.
|
2013-11-14 00:13:39 +04:00
|
|
|
hledger requires GHC 7.2 or greater, and hledger-web requires GHC 7.4 or greater.
|
|
|
|
|
|
|
|
Also note that some Haskell packages depend on C packages, and cabal
|
|
|
|
currently isn't able to install or identify those for you. A common
|
|
|
|
issue is not having all the ncurses C libraries installed. A quick way
|
|
|
|
to ensure you have all required C libs is to
|
|
|
|
[install hledger once with your system package manager](#install-with-your-system-package-manager)
|
|
|
|
before installing the latest version with cabal.
|
|
|
|
|
2013-04-19 23:41:42 +04:00
|
|
|
Then install the hledger command-line tool:
|
2013-04-01 02:16:06 +04:00
|
|
|
|
|
|
|
$ cabal update
|
2013-04-01 19:44:25 +04:00
|
|
|
$ cabal install hledger [--dry-run]
|
|
|
|
$ hledger --version
|
|
|
|
|
|
|
|
You should see the proper version reported.
|
|
|
|
If you get "could not resolve dependencies", "hledger not found",
|
|
|
|
or any other problem, see [troubleshooting](#troubleshooting).
|
|
|
|
Also note, to use non-ascii characters like £ in your data, you might need to [configure a suitable locale](MANUAL.html#locale).
|
|
|
|
|
|
|
|
To also install the web interface (slightly harder), do:
|
|
|
|
|
|
|
|
$ cabal install hledger-web [--dry-run]
|
|
|
|
$ hledger-web --version
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
This also installs hledger if not already installed, and the hledger-web command
|
|
|
|
will also be available as hledger's `web` subcommand.
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
Other add-on packages are available on Hackage, although some of these are
|
|
|
|
unmaintained or work only on certain platforms:
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
- [hledger-chart](http://hackage.haskell.org/package/hledger-chart)
|
|
|
|
- [hledger-interest](http://hackage.haskell.org/package/hledger-interest)
|
|
|
|
- [hledger-irr](http://hackage.haskell.org/package/hledger-irr)
|
2013-04-15 05:16:26 +04:00
|
|
|
- [hledger-vty](http://hackage.haskell.org/package/hledger-vty)
|
2013-04-01 19:44:25 +04:00
|
|
|
|
|
|
|
## Install the latest development version
|
|
|
|
|
|
|
|
To download and build the latest development version of hledger, ensure you have
|
2013-04-07 00:36:51 +04:00
|
|
|
[git](http://git-scm.com) installed, then:
|
2013-04-01 19:44:25 +04:00
|
|
|
|
2013-04-15 05:16:26 +04:00
|
|
|
$ git clone http://github.com/simonmichael/hledger.git
|
2013-04-01 19:44:25 +04:00
|
|
|
$ cd hledger
|
|
|
|
$ cabal update
|
|
|
|
$ cabal install ./hledger-lib ./hledger [./hledger-web]
|
2013-11-14 00:13:39 +04:00
|
|
|
|
2013-11-14 00:17:07 +04:00
|
|
|
The same [notes above](#install-from-hackage-with-cabal) about requirements and checking your installation apply.
|
2013-11-14 00:13:39 +04:00
|
|
|
|
2013-04-01 19:44:25 +04:00
|
|
|
## Troubleshooting
|
2013-04-01 02:16:06 +04:00
|
|
|
|
|
|
|
There are a lot of ways things can go wrong. Here are
|
|
|
|
some known issues and things to try. Please also seek
|
|
|
|
[support](DEVELOPMENT.html#support) from the
|
|
|
|
[IRC channel](irc://irc.freenode.net/#ledger),
|
2013-04-08 21:25:47 +04:00
|
|
|
[mail list](http://hledger.org/list) or
|
|
|
|
[bug tracker](http://hledger.org/bugs).
|
2013-04-01 02:16:06 +04:00
|
|
|
|
|
|
|
Starting from the top, consider whether each of these might apply to
|
|
|
|
you. Tip: blindly reinstalling/upgrading everything in sight probably
|
|
|
|
won't work, it's better to go in small steps and understand the problem,
|
|
|
|
or get help.
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **hledger not found ?**
|
2013-04-01 19:44:25 +04:00
|
|
|
If cabal install succeeded but you get a message like "hledger not found" when you run hledger,
|
|
|
|
you should add cabal's bin directory to your PATH environment variable.
|
|
|
|
Eg on unix-like systems, something like:
|
|
|
|
|
2013-11-07 01:57:53 +04:00
|
|
|
$ echo 'export PATH=$PATH:~/cabal/bin' >> ~/.bash_profile
|
|
|
|
$ source ~/.bash_profile
|
2013-04-01 19:44:25 +04:00
|
|
|
|
2013-11-14 05:46:07 +04:00
|
|
|
#. **hledger --version shows unexpected version ?**
|
|
|
|
Perhaps you have multiple versions of hledger in your PATH. Eg you installed with the system package manager
|
|
|
|
(to get C libs) and then with cabal (to get the latest version), but cabal's bin directory appears too late
|
|
|
|
in the PATH. Move it closer to the front.
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **Did you cabal update ?**
|
2013-04-01 02:16:06 +04:00
|
|
|
If not, `cabal update` and try again.
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **Do you have a new enough version of GHC ?**
|
2013-04-01 02:16:06 +04:00
|
|
|
Run `ghc --version`. hledger requires GHC 7.0 or greater
|
2014-01-09 04:01:25 +04:00
|
|
|
(and on [some platforms](#5551), 7.2.1+ can be helpful).
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **Do you have a new enough version of cabal ?**
|
2014-01-09 04:01:25 +04:00
|
|
|
Avoid ancient versions, which are less capable and more confusing.
|
|
|
|
`cabal --version` should probably report at least 1.16 (and for sandboxed
|
|
|
|
installs, 1.18+). You may be able to upgrade it with:
|
2013-11-14 00:13:39 +04:00
|
|
|
|
2013-04-01 02:16:06 +04:00
|
|
|
$ cabal update
|
2014-01-09 03:37:31 +04:00
|
|
|
$ cabal install cabal-install
|
2013-04-01 02:16:06 +04:00
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **Are your installed GHC/cabal packages in good repair ?**
|
2013-04-01 02:16:06 +04:00
|
|
|
Run `ghc-pkg check`. If it reports problems, some of your packages have
|
2013-11-14 00:13:39 +04:00
|
|
|
become inconsistent, and you should fix these first.
|
2013-04-01 02:16:06 +04:00
|
|
|
[ghc-pkg-clean](https://gist.github.com/1185421) is an easy way.
|
|
|
|
|
2014-01-09 03:38:01 +04:00
|
|
|
#. **cabal says "rejecting: system-fileio-0.3.11, 0.3.10 (conflict: blah blah blah.."**
|
|
|
|
system-fileio does not yet allow text 1.x, making cabal sweat.
|
|
|
|
If your cabal is modern enough, adding `--max-backjumps=10000` should help.
|
|
|
|
([more](https://groups.google.com/d/topic/hledger/FdWGTSAVzYU/discussion)).
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. <a name="cabaldeps" />**cabal can't satisfy the new dependencies due to old installed packages**
|
2013-04-01 02:16:06 +04:00
|
|
|
Cabal dependency failures become more likely as you install more
|
|
|
|
packages over time. If `cabal install hledger-web --dry` says it can't
|
|
|
|
satisfy dependencies, you have this problem. You can:
|
2013-11-14 00:13:39 +04:00
|
|
|
|
2013-04-01 02:16:06 +04:00
|
|
|
a. try to understand which packages to remove (with `ghc-pkg unregister`)
|
|
|
|
or which constraints to add (with `--constraint 'PKG == ...'`) to help cabal
|
|
|
|
find a solution
|
|
|
|
|
|
|
|
b. install into a fresh environment created with
|
|
|
|
[virthualenv](http://hackage.haskell.org/package/virthualenv) or
|
|
|
|
[cabal-dev](http://hackage.haskell.org/package/cabal-dev)
|
|
|
|
|
|
|
|
c. or (easiest) erase your installed packages with
|
|
|
|
[ghc-pkg-reset](https://gist.github.com/1185421) and try again.
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **Dependency or compilation error in one of the new packages ?**
|
2013-04-01 02:16:06 +04:00
|
|
|
If cabal starts downloading and building packages and then terminates
|
|
|
|
with an error, look at the output carefully and identify the problem
|
|
|
|
package(s). If necessary, add `-v2` or `-v3` for more verbose
|
|
|
|
output. You can install the new packages one at a time to troubleshoot,
|
|
|
|
but remember cabal is smarter when installing all packages at once.
|
|
|
|
|
|
|
|
Often the problem is that you need to install a particular C library
|
|
|
|
using your platform's package management system. Or the dependencies
|
|
|
|
specified on a package may need updating. Or there may be a compilation
|
|
|
|
error. If you find an error in a hledger package, check the
|
2013-04-07 00:36:51 +04:00
|
|
|
[recent commits](http://github.com/simonmichael/hledger/commits) to
|
2013-04-01 02:16:06 +04:00
|
|
|
see if the [latest development version](#installing) might have a fix.
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **ExitFailure 11**
|
2013-04-01 02:16:06 +04:00
|
|
|
See
|
|
|
|
[http://hackage.haskell.org/trac/hackage/ticket/777](http://hackage.haskell.org/trac/hackage/ticket/777).
|
|
|
|
This means that a build process has been killed, usually because it grew
|
|
|
|
too large. This is common on memory-limited VPS's and with GHC 7.4.1.
|
|
|
|
Look for some memory-hogging processes you can kill, increase your RAM,
|
|
|
|
or limit GHC's heap size by doing `cabal install ... --ghc-options='+RTS
|
|
|
|
-M400m'` (400 megabytes works well on my 1G VPS, adjust up or down..)
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. <a name="5551" />**Can't load .so/.DLL for: ncursesw (/usr/lib/libncursesw.so: file too short)**
|
2013-04-01 02:16:06 +04:00
|
|
|
(or similar): cf [GHC bug #5551](http://hackage.haskell.org/trac/ghc/ticket/5551).
|
|
|
|
Upgrade GHC to 7.2.1, or try your luck with [this workaround](http://eclipsefp.github.com/faq.html).
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. <a name="iconv" />**Undefined iconv symbols on OS X**
|
2013-04-01 02:16:06 +04:00
|
|
|
This kind of error:
|
|
|
|
|
|
|
|
Linking dist/build/hledger/hledger ...
|
|
|
|
Undefined symbols:
|
|
|
|
"_iconv_close", referenced from:
|
|
|
|
_hs_iconv_close in libHSbase-4.2.0.2.a(iconv.o)
|
|
|
|
"_iconv", referenced from:
|
|
|
|
_hs_iconv in libHSbase-4.2.0.2.a(iconv.o)
|
|
|
|
"_iconv_open", referenced from:
|
|
|
|
_hs_iconv_open in libHSbase-4.2.0.2.a(iconv.o)
|
|
|
|
|
|
|
|
probably means you are on a mac with macports libraries installed, cf
|
|
|
|
[http://hackage.haskell.org/trac/ghc/ticket/4068](http://hackage.haskell.org/trac/ghc/ticket/4068).
|
|
|
|
To work around temporarily, add this --extra-lib-dirs flag:
|
|
|
|
|
|
|
|
$ cabal install hledger --extra-lib-dirs=/usr/lib
|
|
|
|
|
|
|
|
or permanently, add this to ~/.cabal/config:
|
2013-11-14 00:13:39 +04:00
|
|
|
|
2013-04-01 02:16:06 +04:00
|
|
|
extra-lib-dirs: /usr/lib
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **hledger-vty requires curses-related libraries**
|
2013-04-01 02:16:06 +04:00
|
|
|
On Ubuntu, eg, you'll need the `libncurses5-dev` package. On Windows,
|
|
|
|
these are not available (unless perhaps via Cygwin.)
|
|
|
|
|
2013-11-14 00:13:39 +04:00
|
|
|
#. **hledger-chart requires GTK-related libraries**
|
2013-04-01 02:16:06 +04:00
|
|
|
On Ubuntu, eg, install the `libghc6-gtk-dev` package. See also [Gtk2Hs installation notes](http://code.haskell.org/gtk2hs/INSTALL).
|