【问题标题】:How do you set up a local dev environment to mimic production Ghost env on OpenShift?您如何设置本地开发环境来模拟 OpenShift 上的生产 Ghost 环境?
【发布时间】:2015-11-10 19:53:43
【问题描述】:

我在 OpenShift 上建立了一个 Ghost 博客,发现这个过程相当简单。该站点已启动并正在运行,我什至设置了 Jenkins 以在需要推动更改时进行持续集成。

我还没有进行任何重大更改(到目前为止只是样式更新),因为我不知道如何设置测试/开发环境。在将较大的代码更改提交到 OpenShift 上的主 Git 存储库之前,我应该如何设置一个可以测试较大代码更改的环境?

有没有办法让应用程序在本地运行?我已经尝试 cd-ing 到我的终端(在 Mac 上)中的应用程序目录,但是当我运行 npm start 时,我得到以下...

> openshift-ghost-quickstart@ start /path_to_my_app/dev/app
> node index

Unhandled rejection Error: Cannot find module '/path_to_my_app/dev/app/node_modules/ghost/node_modules/sqlite3/lib/binding/node-v11-darwin-x64/node_sqlite3.node'

(node_sqlite3.node 确实存在,顺便说一句)

我需要做些什么来设置它,以便我能够使用相同的代码库和 repo,但在实际将它们提交到 repo 之前在本地查看我的更改?任何帮助,将不胜感激。多谢!

【问题讨论】:

  • 尝试运行 npm update 以克服您列出的特定错误。
  • 谢谢@mbaird!运行 npm update 后,我现在在运行 npm start 时看到以下内容: > openshift-ghost-quickstart@ start /path-to-app > node index Migrations: Database initialisation required for version 003 Migrations: Creating tables... Migrations:创建表:发布未处理的拒绝错误:SQLITE_CANTOPEN:无法在 Client_SQLite3.acquireRawConnection (/path-to-app/node_modules/ghost/node_modules/knex/lib/dialects/sqlite3/index.js:89:10) 处打开数据库文件您认为这只是权限问题还是我需要更新 config.js 中的一些内容?

标签: git openshift development-environment ghost-blog ghost


【解决方案1】:

这也让我有一段时间了。要使其正常工作,需要做两件事:

  1. 在 node_modules/ghost/node_modules 目录下再次安装 sqlite3 - 默认情况下它具有来自 Openshift 的 linux 绑定。您需要 OSX 绑定

  2. 在现有的 content 文件夹中创建一个 data 文件夹。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-02
    • 1970-01-01
    • 2018-06-04
    • 1970-01-01
    • 2014-10-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多