Rails5 Directly inheriting from from ActiveRecord::Migration is not supported. Sorcery Gem

You have to specify the version in brackets like it says. Have you added any migrations since upgrading?

Example change from:

class SorceryCore < ActiveRecord::Migration

to

class SorceryCore < ActiveRecord::Migration[5.1]

You can add the version to all migrations by running this from your Rails root directory:

grep -rl ActiveRecord::Migration$ db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g"