rails still looking for old foreign key after removing a model

... so I took out the Profile model

What does "took out" mean? What exactly did you do? Is it the exact reverse of how you created that model to start with?

ActiveRecord::InvalidForeignKey (Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails (`socialnetworking_development`.`posts`, CONSTRAINT `fk_rails_cd61a4aa45` FOREIGN KEY (`user_id`) REFERENCES `profiles` (`id`)):

Given that you're seeing a *database-generated* error -- have you looked at the relationships, i.e. foreign keys, in the referenced tables in that database?