RubyMoney/money · error · Money::Currency::MissingAttributeError

Can't call Currency.all - currency '#{currency}' is missing

Error message

Can't call Currency.all - currency '#{currency}' is missing the attribute 'priority'

What it means

Error "Can't call Currency.all - currency '#{currency}' is missing the attribute 'priority'" thrown in RubyMoney/money.

Source

Thrown at lib/money/currency.rb:140

      # https://www.answers.com/redirectSearch?query=fractional-monetary-unit-subunit
      #
      # See https://en.wikipedia.org/wiki/List_of_circulating_currencies and
      # https://metacpan.org/release/TNGUYEN/Locale-Currency-Format-1.28/view/Format.pm
      def table
        @table ||= Loader.load_currencies
      end

      # List the currencies imported and registered
      # @return [Array]
      #
      # @example
      #   Money::Currency.all()
      #   [#<Currency ..USD>, 'CAD', 'EUR']...
      def all
        table.keys.map do |curr|
          c = Currency.new(curr)
          if c.priority.nil?
            raise MissingAttributeError.new(:all, c.id, :priority)
          end

          c
        end.sort_by(&:priority)
      end

      # We need a string-based validator before creating an unbounded number of
      # symbols.
      # http://www.randomhacks.net.s3-website-us-east-1.amazonaws.com/2007/01/20/13-ways-of-looking-at-a-ruby-symbol/#11
      # https://github.com/RubyMoney/money/issues/132
      #
      # @return [Set]
      def stringified_keys
        @stringified_keys ||= stringify_keys
      end

      # Register a new currency
      #

View on GitHub (pinned to 26e2829c34)

When it happens

Trigger: Thrown at lib/money/currency.rb:140 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of RubyMoney/money@26e2829c34 (2026-08-23). Data as JSON: /api/errors/a699ea0725e44a58. Report an issue: GitHub.