I’ve recently received this error when using UTF8MB4 with Rails.
Mysql2::Error: Specified key was too long; max key length is 767 bytes
After finding this issue on the Rails GitHub page, this is the fix:
Create a file called config/initializers/mysql.rb
and copy the following into it
Hope this helps!