Yes like Simpleton posted above the PG gem is causing the problem. Imo a better solution would be to move the PG gem inside production in your gemfile and run;
bundle install --without production
Then you should be able to run the rake task without problems