Your rake task needs to boot the Rails environment prior to running. That way you can access the classes.
To do this, you need to run the environment
task. To make this happen, change your task definition to
task :insert_properties => :environment do