Search code examples
ruby-on-railsdeploymentcapistranounicorn

We're sorry, but something went wrong capistrano deploy


I'm using nginx + unicorn + capistrano to deploy my app on server. My db is sqlite because i have only 1 little table in it. My deploy.rb config is here deploy.rb

When i make cap deploy:setup and then cap deploy:cold the app works fine. When i make some changes and then commit and run cap deploy i have

**We're sorry, but something went wrong.**

In production.rb i have the following error

Processing by DomainsController#index as */*
Completed 500 Internal Server Error in 1ms

ActiveRecord::StatementInvalid (Could not find table 'domains'):
app/controllers/domains_controller.rb:8:in `index'

I can't understand why i see this error? how can check where i'm wrong?


Solution

  • Each deploy is creating new directory on your server called current and since your database isn't in source control version system (and it should not be) it is lost after each deploy. You need to put your sqlite database into shared folder and symlink it in your deploy.