database.yml 加入
charset: utf8mb4
encoding: utf8mb4
collation: utf8mb4_unicode_ci
创建migration ,更改要存放表情的数据表
execute "ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
如果该字段是string类型 要加入这一行
execute "ALTER TABLE table_name CHANGE table_field VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"