当我尝试连接到 mysql 数据库时出现此错误.问题是该应用程序可以运行数周,然后我随机收到此消息.当我收到此错误消息时,应用程序无法重新连接到数据库,直到我重新启动它.
I'm getting this error when I'm trying to connect to a mysql database. The problem is that the application works for weeks, and then randomly I get this message. When I get this error message the application is not able to reconnect to the database until I restart it.
我正在使用配置文件连接数据库,并且指定了适配器...数据库配置不是在运行时生成的.
I'm using a configuration file to connect to the database, and the adapter is specified...the database configuration is not generated at runtime.
你知道发生了什么吗?
推荐答案当我尝试运行命令行脚本(这里假设为my_script")时,发生了同样的错误.原因是:
when I tried to run a command line script (let's say 'my_script' here), the same error happened. The reasons were:
因此,以下是我的解决方案:
So, the following is the solution in my case:
$ RAILS_ENV=生产 my_script
$ RAILS_ENV=production my_script
更多推荐
数据库配置没有指定适配器
发布评论