gollum/gollum · error · ArgumentError

emoji `#{name}' not found

Error message

emoji `#{name}' not found

What it means

helpers#emoji(name) looks the shortname up in the Gemojione index (Gemojione.index.find_by_name) and fails with ArgumentError "emoji `name' not found" when the name is unknown. Callers use it to render the PNG for an :emoji: shortname, so any name outside the installed gemojione index crashes the lookup.

Source

Thrown at lib/gollum/helpers.rb:70

      halt mustache :error
    end

    def not_found(msg = nil)
      @message = msg || "The requested page does not exist."
      status 404
      return mustache :error
    end
    
    def not_found_proc
      not_found_msg = 'Not found.'
      Proc.new {[404, {'Content-Type' => 'text/html', 'Content-Length' => not_found_msg.length.to_s}, [not_found_msg]]}
    end
    
    def emoji(name)
      if emoji = Gemojione.index.find_by_name(name)
        IO.read(EMOJI_PATHNAME.join("#{emoji['unicode'].downcase}.png"))
      else
        fail ArgumentError, "emoji `#{name}' not found"
      end
    end
  end
end

View on GitHub (pinned to d00fefc89b)

Solutions

  1. Correct the shortname - check it resolves: Gemojione.index.find_by_name(name)
  2. Upgrade the gemojione gem to a version whose index includes the emoji
  3. Rescue ArgumentError at the call site and render a fallback (blank image or the raw :name: text)

Example fix

# before
emoji(name)

# after
return fallback_image(name) unless Gemojione.index.find_by_name(name)
emoji(name)
Defensive patterns

Strategy: validation

Validate before calling

return fallback_image unless Gemojione.index.find_by_name(name)
emoji(name)

Type guard

def known_emoji?(name)
  !Gemojione.index.find_by_name(name).nil?
end

Try / catch

begin
  emoji(name)
rescue ArgumentError => e
  raise unless e.message =~ /emoji `.*' not found/
  fallback_image(name)
end

Prevention

When it happens

Trigger: emoji(name) with a typo, a vendor-specific shortname like :shipit:, or a name from a newer Unicode/emoji set than the installed gemojione gem supports.

Common situations: Upgrading gollum/gemojione where aliases were renamed or dropped; user-authored content using custom emoji names; templates hardcoding shortnames that drift from the index.

Related errors


AI-assisted analysis of gollum/gollum@d00fefc89b (2026-08-21). Data as JSON: /api/errors/b57d1b9421814b70. Report an issue: GitHub.