通过 nginx 和 unicorn 访问 rails 应用程序时出现 Mysql2 错误 [英] Mysql2 Error while accessing rails app via nginx and unicorn

查看:34
本文介绍了通过 nginx 和 unicorn 访问 rails 应用程序时出现 Mysql2 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了我的生产服务器,并且在 nginx 上使用 capistrano 3.1 和在 Ubuntu Server 12.04LTS 上使用 unicorn 部署了 rails 应用程序.当通过普通 rails 服务器访问时,该应用程序运行良好,但每当我尝试通过 unicorn 运行服务器时,它都会说它无法访问数据库中的某些表.附上错误快照和数据库查询快照.

I have setup my production server and the rails app is deployed using capistrano 3.1 on nginx and unicorn on Ubuntu Server 12.04LTS. The app is working fine when accessed via normal rails server but whenever I try to run the server via unicorn its says that it cant access some tables in the database. Attached is the snapshot of the error and the snapshot of the database queries.

推荐答案

如上面评论中所述,我清除了数据库、文件夹并在删除 capistrano 的迁移扩展后重新运行部署,一切正常.

As noted above in the comments, I cleared the database, the folders and re-ran the deployment after removing the migration extension for capistrano and everything worked just fine.

这篇关于通过 nginx 和 unicorn 访问 rails 应用程序时出现 Mysql2 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆