Internal Server Error every time I push up my WordPress Project to Heroku

The problem ended up being that the wp_rewrite was not flushed on the push to the Heroku server. So, what I ended up doing was creating a file in the root directory with the following code:

<?php
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
?>

Then I added a deploy hook for heroku via command line

heroku addons:add deployhooks:http --url=http://example.com/reset_permalinks.php

So, now when I deploy my application on the Heroku server, it runs the flush_rules() method and all is good. Thanks s_ha_dum!