【问题标题】:DB Defaults to SQLite3 on DigitalOceanDB 默认为 DigitalOcean 上的 SQLite3
【发布时间】:2015-06-27 16:50:07
【问题描述】:

我无法在数字海洋(w/ubuntu&nginx&passenger)上设置我的 rails 应用程序。我的应用程序不会连接到 DO 上的 postgresql 数据库,并且由于某种原因似乎默认为 SQLite3。在我的本地环境中,一切都很好并连接到 postgresql 但在浏览器中弹出此错误: "SQLite3::CantOpenException". 我对配置环境有点陌生,但我将它添加到 .bashrc 文件中,认为这可能就是它不起作用的原因,但以下代码行什么也没做: export APP_ENV="production" 我不确定我做错了什么,当我创建应用程序时,我什至这样做: rails new myproject -T -d postgresql 我还阅读了一个教程,该教程建议我将密码输入我的应用程序,但这似乎是一件完全荒谬的事情。我很确定我需要设置环境变量,但我认为这就是“rails new myproject -T -d postgresql”末尾的 postgresql 所做的......我迷路了。

【问题讨论】:

标签: ruby-on-rails postgresql environment-variables production-environment digital-ocean


【解决方案1】:

这是 NGINX 的解释:

http://linux.ioerror.us/2014/02/how-can-i-use-environment-variables-in-nginx-conf/

或者您可能需要在 NGINX 配置文件中设置环境变量:

server {
   listen 80;
   server_name example.com;

   set $ENV_app "production";
}

https://github.com/magento/magento2/wiki/Nginx-Configuration-Settings-and-Environment-Variables

【讨论】:

  • 我不确定这是否可行,因为我正在使用 nginx ;|但也许我错了
  • 使用 nginx 配置示例编辑。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-31
  • 2013-10-10
  • 2018-01-27
  • 2012-05-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多