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
- Correct the shortname - check it resolves: Gemojione.index.find_by_name(name)
- Upgrade the gemojione gem to a version whose index includes the emoji
- 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
- Check Gemojione.index.find_by_name(name) before rendering :shortnames: from user content
- Pin/upgrade the gemojione gem deliberately; alias sets change between versions
- Render unknown shortnames as literal text instead of crashing
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
- Changing this resource is not allowed.
- The file you are trying to upload already exists.
- You are trying to save this page under a path (#{page.escape
- The patch does not apply.
- Could not compare these two revisions, no differences were f
AI-assisted analysis of gollum/gollum@d00fefc89b (2026-08-21).
Data as JSON: /api/errors/b57d1b9421814b70.
Report an issue: GitHub.