I had a problem this weekend after I upgraded from Ubuntu 22.04 to 23.04. Mastodon wouldn't come up afterward.
I then tried rebuilding Mastodon but got the same error during the build that I saw in syslog, that a file couldn't be found.
I eventually got Mastodon rebuilt by using "bundle install --redownload" instead of "bundle install"
Just comparing notes to learn something that might save me from the same aggravation some day. Did you see this same problem, given that Ubuntu is a Debian derivative?
I did see other Admins mention that they had problems upgrading their Debian versions.