文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
使用命令行
备份! 总是在更新前执行一次备份。首先请阅读 备份指南 。
在 mac 上使用命令行
下面的截屏视频显示了如何按步更新 Ghost ,在从下载了 zip 文件到 ~/Downloads
并且安装 Ghost 到 ~/ghost
的前提下。 注意:~在 mac 和 linux 中表示用户主目录。
步骤如下:
cd ~/Downloads
- 切换到下载的最新版本 Ghost 所在的目录unzip ghost-0.3.1.zip -d ghost-0.3.3
- 解压 ghost 为 ghost-0.3.3cd ghost-0.3.3
- 进入ghost-0.3.3
目录内ls
- 显示当前目录下所有文件和文件夹cp *.md *.js *.txt *.json ~/ghost
- 复制所有~/ghost
目录下的 .md .js .txt 和 .json 文件cp -R core ~/ghost
- 复制core
目录和它包含的所有内容到~/ghost
cp -R content/themes/casper ~/ghost/content/themes
- 复制casper
目录和它包含的所有文件到~/ghost/content/themes
cd ~/ghost
-切换到~/ghost
目录下npm install --production
- 安装 Ghostnpm start
- 启动 Ghost
在 linux 上使用命令行
- 首先你需要知道最新版本 Ghost 的 URL。通常为
http://ghost.org/zip/ghost-latest.zip
- 通过
wget http://ghost.org/zip/ghost-latest.zip
下载最新的 zip 文件(或者带着版本号的 Ghost 文件的 URL) - 使用
unzip -uo ghost-0.3.*.zip -d path-to-your-ghost-install
解压 - 运行
npm install --production
安装最新的依赖包 - 最后,重启 Ghost 使生效 此外 , howtoinstallghost.com 也介绍了如何在 linux 上更新 Ghost。
如何更新 DigitalOcean Droplet
备份! 总是在更新前执行一次备份。首先请阅读 备份指南 。
- 首先你需要知道最新版本 Ghost 的 URL。通常为
http://ghost.org/zip/ghost-latest.zip
- 一旦你获取了最新版本的 URL ,在你的 Droplet 控制台中输入
cd /var/www/
切换到 Ghost 代码库 - 下一步,输入
wget http://ghost.org/zip/ghost-latest.zip
(或者带着版本号的 Ghost 文件的 URL) - 使用
unzip -uo ghost-0.3.*.zip -d ghost
解压 - 使用
chown -R ghost:ghost ghost/*
确保所有文件都拥有正确的权限 - 运行
npm install
安装最新的依赖包 - 最后,使用
service ghost restart
重启 Ghost 使改变生效
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论