Adding a custom emoji broke the site

Yes, something with it or with:
https://github.com/discourse/discourse/commit/1a7e954e09c465aac5636f83470bde0a8fe887b2

I’ve managed to fix it by finding the troublesome emoji and deleting it (I don’t know Ruby so don’t laugh too much on my usage of it :slight_smile: ):

./launcher enter app
su discourse
bundle exec rails c
CustomEmoji.find_each do |item,obj|
    print item.name+"\n"
    print "->"+item.upload.url+"\n"
end

The loop will break because item.upload.url is not defined for every item. The name of the broken emoji put in the next line:

em = CustomEmoji.find_by(name: "NAME")
em.distroy!

Emoji.clear_cache

Exit.

4 curtidas