0

So I've got my rails app on a linode box using capistrano and rvm in the app, with nginx, postgres, and Ubuntu 13.04 on the server. My app is the one from the teamtreehouse tutorial. See it on heroku here. Using the tutorial here, I was able to cap deploy:cold. Now I'm getting the fateful "We're sorry, something went wrong" 500 page. Usually that's a database problem?

First question: How do I find out what the root of this problem is? In the shared/production.log I see my migrations went through:

Connecting to database specified by database.yml
Migrating to CreateStatuses (20120718214245)
...(and so on until
Migrating to AddAvatarToUsers (20130505213153)

Nothing after that.

Second question: I went to check what's in my database and the answer is nothing besides the tables. That is, my seeds.rb file did not get added. Maybe that will solve my problem? If it does, I'm curious why.

Let me know!

morgs32
  • 1,439
  • 3
  • 17
  • 26

2 Answers2

1

Add a task to deploy.rb like advised here

Then use: cap deploy:seed

Community
  • 1
  • 1
morgs32
  • 1,439
  • 3
  • 17
  • 26
0

Running the following command should seed your database with the data you are expecting.

rake db:seed
ahal
  • 1
  • 1
  • Not until I created the task in deploy.rb, with `desc "reload the database with seed data"/n task :seed do run "cd #{current_path} && bundle exec rake db:seed RAILS_ENV=#{rails_env}" end` But now I'm getting this other problem: – morgs32 May 15 '13 at 17:44
  • (Rake aborted) `** [out :: ] hostname "localhost" does not match the server certificate` and it seems to have to do with my mailer. The railscast (#335) had me use postfix. I wonder if I shouldn't have done that. `** [out :: 69.164.192.68] /home/treebook/apps/treebookvps/shared/bundle/ruby/2.0.0/gems/mail-2.4.4/lib/mail/network/delivery_methods/smtp.rb:144:in `deliver!'` – morgs32 May 15 '13 at 17:50
  • How to add task here: http://stackoverflow.com/questions/7461985/how-to-seed-the-production-database-using-the-capistrano-gem – morgs32 May 15 '13 at 18:24