cherry-picked commit 65b8bae892cc18129753 from iortega/db-populate, replacing deprecated RAILS_ROOT in favor of Rails.root