gpt4 book ai didi

ruby-on-rails - 如何使用 capistrano 部署 rails sqlite3 数据库

转载 作者:行者123 更新时间:2023-12-03 17:31:44 25 4
gpt4 key购买 nike

我正在尝试这样部署:

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

但一直在日志文件中显示错误:

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')

但在 current/db 文件夹中创建了 production.sqlite3 。

在 localhost:3000 中它工作正常。

我如何使用 capistrano 迁移数据库以用于生产?

我使用 nginx 和 unicorn,这是我的 repo https://github.com/EgorkZe/bh

最佳答案

更好的是,更改您的数据库配置:

production:
adapter: sqlite3
database: /absolute/path/to/shared/db/production.sqlite3 # instead of db/production.sqlite3

关于ruby-on-rails - 如何使用 capistrano 部署 rails sqlite3 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23067439/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com