A pure-Ruby port of Ledger, the plain-text
accounting tool. Parses Ledger-format journal files and produces balance,
register, and print reports — no C extensions, no external dependencies
beyond bigdecimal.
Status: Active, early (v0.1). Core journal format, balance validation, and the three main reports work; budgets, periodic transactions, and valuation directives are not yet implemented. See Roadmap.
Ledger already has ports in Haskell (hledger), Python (Beancount), Scala (Abandon), Go, PureScript, and more — but not Ruby. This fills that gap for teams and hobbyists who want plain-text accounting inside a Ruby or Rails codebase, without shelling out to another language's binary.
gem install ruby_ledgerOr add to your Gemfile:
gem "ruby_ledger"ruby_ledger balance -f myjournal.ledger
ruby_ledger register -f myjournal.ledger [ACCOUNT_FILTER]
ruby_ledger print -f myjournal.ledgerGiven this journal:
2026-01-02 * Opening Balance
Assets:Bank:Checking $1000.00
Equity:Opening Balances
2026-01-05 * Coffee Shop
Expenses:Food:Coffee $4.50
Assets:Bank:Checking
ruby_ledger balance -f journal.ledger prints:
$995.50 Assets:Bank:Checking
$-1000 Equity:Opening Balances
$4.50 Expenses:Food:Coffee
----------------------------------------
$0
Note the second posting in each transaction above has no amount — Ruby Ledger auto-balances a single elided posting per transaction, same as Ledger itself.
require "ruby_ledger"
journal = RubyLedger::Journal.load("myjournal.ledger")
RubyLedger::Reports::Balance.new(journal).totals
# => { "Assets:Bank:Checking" => { "$" => #<BigDecimal 995.50> }, ... }
RubyLedger::Reports::Register.new(journal, account_filter: "Checking").rowsYYYY-MM-DDorYYYY/MM/DDdated transactions*(cleared) /!(pending) status markers, on transactions and postings- Multi-line postings, two-or-more-space account/amount separation
- Elided (auto-balancing) posting amounts
$,£,€,¥symbolic commodities and trailing commodities (50 AAPL);comments (line and inline), plus#,%,|,*full-line commentsincludedirectives
Not yet supported: budgets, periodic/forecast transactions, valuation and
lot pricing, account/commodity declarations, virtual postings. PRs welcome
— see CONTRIBUTING.md.
The core gem is framework-agnostic by design — the journal file, not a
database, stays the source of truth. See
ruby_ledger-rails/
for a mountable Rails engine that wraps this gem with:
- Controllers/views rendering
balanceandregisteras HTML - Optional ActiveRecord read-models synced from the journal file, for fast querying and dashboards
- A file-watcher to re-parse on journal changes in development
- Budget and periodic transaction directives
- Commodity price history / valuation
-
virtualand(parenthesized)postings - CSV import helper
- Compatibility test suite run against Ledger's own upstream fixtures
bundle install
bundle exec rspec
bundle exec rubocopBug reports and PRs are welcome at https://github.com/aburoos/ruby_ledger. Please see CONTRIBUTING.md first.
MIT — see LICENSE.txt.
| Project | Language |
|---|---|
| Ledger | C++ |
| hledger | Haskell |
| Beancount | Python |
| Abandon | Scala |
| Ruby Ledger | Ruby |
See also the full comparison on plaintextaccounting.org and the Ledger wiki Ports page.