Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy Rails sqlite3 database with Capistrano?

I deploy like this:

bundle exec cap deploy:cold
RAILS_ENV=production rake db:migrate
bundle exec cap deploy:migrate

Error in log file:

I, [2014-04-14T14:15:14.853543 #10769]  INFO -- : Started GET "/users/sign_up" for
176.192.228.14 at 2014-04-14 14:15:14 -0400
I, [2014-04-14T14:15:14.856055 #10769]  INFO -- : Processing by
Devise::RegistrationsController#new as HTML
I, [2014-04-14T14:15:14.857398 #10769]  INFO -- : Completed 500 Internal Server Error
in 1ms
F, [2014-04-14T14:15:14.860844 #10769] FATAL -- :
ActiveRecord::StatementInvalid (Could not find table 'users')

But in the current/db folder was created production.sqlite3. On localhost:3000 it works. How can I migrate the database for production with Capistrano?

I use Nginx and Unicorn and this is my repository.

like image 807
EgorkZe Avatar asked Jan 23 '26 02:01

EgorkZe


1 Answers

Better yet, change up your db configuration:

production:
  adapter: sqlite3
  database: /absolute/path/to/shared/db/production.sqlite3 # instead of db/production.sqlite3
like image 195
Mark Murphy Avatar answered Jan 25 '26 18:01

Mark Murphy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!