自己之前搭建好的环境:
现在去另外一台Mac中恢复整套环境。
已经下载了代码,可以
make debug
了。但是想要继续实现
1 | make deploy |
不过发现需要去添加sshpass:
1 2 3 4 5 | ================================================================================ Upload for desktop_app_framework_electron sshpass -f /Users/xxx/dev/crifan/gitbook/gitbook_template/common/config/deploy/deploy_server_password.txt rsync -avzh --progress --stats -- delete --force /Users/xxx/dev/crifan/gitbook/gitbook_template/generated/books/desktop_app_framework_electron/release/desktop_app_framework_electron root@149.x.x.189:/data/wwwroot/book.crifan.com/books make: sshpass: No such file or directory make: *** [upload] Error 1 |
后记:同样问题:

然后去:
【已解决】Mac中再次尝试安装sshpass
继续试试
遇到其他错误:
【已解决】Mac中sshpass加上rsync运行报错:Host key verification failed rsync error unexplained error code 255 rsync.c sender
过了会就正常上传成功了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 。。。 desktop_app_framework_electron / website / support_python / desktop_app_framework_electron / website / support_python / index.html 62.72K 100 % 4.27MB / s 0 : 00 : 00 (xfer #153, to-check=0/193) total: matches = 0 hash_hits = 0 false_alarms = 0 data = 45195793 Number of files: 193 Number of files transferred: 153 Total file size: 45.20M bytes Total transferred file size: 45.20M bytes Literal data: 45.20M bytes Matched data: 0 bytes File list size: 5420 File list generation time: 0.011 seconds File list transfer time: 0.000 seconds Total bytes sent: 39.36M Total bytes received: 3.63K sent 39.36M bytes received 3.63K bytes 846.51K bytes / sec total size is 45.20M speedup is 1.15 |
继续:
期间发现提示有几个图片找不到
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | debug: Applying case -transforming CSS... debug: Rasterizing SVG images... debug: Converting XHTML to Mobipocket markup... debug: Failed to find image: ../.. /assets/img/electron_python_example_code .png debug: Failed to find image: ../.. /assets/img/electron_python_launch_ui .png debug: Failed to find image: ../.. /assets/img/electron_python_zerorpc_working .png debug: Failed to find image: ../.. /assets/img/electron_python_hello_caculator .png debug: Failed to find image: ../../.. /assets/img/html_textarea_show_js_output .png debug: Failed to find image: ../../.. /assets/img/electron_devtools_and_console_log .png debug: Failed to find image: ../../.. /assets/img/electron_app_no_main_js_log .png debug: Failed to find image: ../../.. /assets/img/electron_app_mitmdumpurlsaver .png debug: Failed to find image: ../../.. /assets/img/electron_app_contents_bin .png debug: Failed to find image: ../../.. /assets/img/terminal_see_main_js_log .png debug: Failed to find image: ../../.. /assets/img/devtools_see_render_js_log .png debug: Failed to find image: ../../.. /assets/img/see_log_after_toggle_devtools .png debug: Serializing markup content... debug: Compressing markup content... debug: Generating MOBI index for a book debug: MOBI output written to /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmp-26273ZRYx6iNhK5RX/index .mobi debug: Output saved to /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmp-26273ZRYx6iNhK5RX/index .mobi debug: calling hook "finish" |
抽空需要去看看。
继续:
1 2 3 4 5 6 7 8 9 | Commit for desktop_app_framework_electron rsync - avzh - - progress - - stats - - delete - - force / Users / xxx / dev / crifan / gitbook / gitbook_template / generated / books / desktop_app_framework_electron / release / desktop_app_framework_electron / Users / crifan / dev / dev_root / github / github.io / crifan.github.io building file list ... 193 files to consider rsync: mkdir "/Users/crifan/dev/dev_root/github/github.io/crifan.github.io" failed: No such file or directory ( 2 ) rsync error: error in file IO (code 11 ) at / BuildRoot / Library / Caches / com.apple.xbs / Sources / rsync / rsync - 52.200 . 1 / rsync / main.c( 545 ) [receiver = 2.6 . 9 ] rsync: connection unexpectedly closed ( 8 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12 ) at / BuildRoot / Library / Caches / com.apple.xbs / Sources / rsync / rsync - 52.200 . 1 / rsync / io.c( 453 ) [sender = 2.6 . 9 ] make: * * * [commit] Error 12 |
此处错误,是已知的,没有对应目录。
所以去新建对应目录
-》
先去新建一个crifan.github.io
1 | git clone https: //github .com /crifan/crifan .github.io.git |
下载,但是速度慢:
然后去:
【已解决】mac中给git加代理加速git clone下载代码的速度
然后去把对应本地crifan.github.io.git的路径
1 2 | xxx@xxx ~ /dev/crifan/crifan .github.io master pwd /Users/xxx/dev/crifan/crifan .github.io |
更新到之前Makefile中:
/Users/xxx/dev/crifan/gitbook/gitbook_template/common/gitbook_makefile.mk
1 2 3 | # if need commit, change these to yours # GITHUB_IO_PATH=/Users/crifan/dev/dev_root/github/github.io/crifan.github.io GITHUB_IO_PATH = / Users / xxx / dev / crifan / crifan.github.io |

然后再去试试
1 | make deploy |
可以继续了:
期间
1 2 3 4 5 | Untracked files: (use "git add < file >..." to include in what will be committed) desktop_app_framework_electron/ |
说明的确开始尝试去push了。
1 2 3 4 5 6 7 8 9 10 11 12 13 | create mode 100644 desktop_app_framework_electron /website/support_python/index .html On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) nothing to commit, working tree clean Enumerating objects: 143, done . Counting objects: 100% (143 /143 ), done . Delta compression using up to 8 threads Compressing objects: 100% (138 /138 ), done . Writing objects: 100% (142 /142 ), 36.60 MiB | 23.64 MiB /s , done . Total 142 (delta 40), reused 0 (delta 0) |
等待了一会后,就完成了
1 2 3 4 5 6 7 | remote: Resolving deltas: 100% (40 /40 ), completed with 1 local object. To https: //github .com /crifan/crifan .github.io.git 604b6d1..f629463 master -> master /Users/xxx/dev/crifan/gitbook/gitbook_template/books/desktop_app_framework_electron ================================================================================ Deploy for desktop_app_framework_electron xxx@xxx ~ /dev/crifan/gitbook/gitbook_template/books/desktop_app_framework_electron master |

至此,终于完整恢复了gitbook的template的环境。
后续其他gitbook写好后,就可以用
1 | make deploy |
愉快的发布了。