After 24 hours of trying to find the problem with my app. I finally found the problem.
I ran
rake assets:precompile RAILS_ENV=production
This solution stopped working with rails 4, here is the updated one: just pass a dummy database as mentioned in this article:
https://iprog.com/posting/2013/07/errors-when-precompiling-assets-in-rails-4-0
The command is: bundle exec rake RAILS_ENV=production DATABASE_URL=postgresql://user:pass@127.0.0.1/dbname assets:precompile