Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md中能否添源码编译说明 #3

Closed
aizaimenghuangu opened this issue Mar 5, 2018 · 15 comments
Closed

README.md中能否添源码编译说明 #3

aizaimenghuangu opened this issue Mar 5, 2018 · 15 comments

Comments

@aizaimenghuangu
Copy link

如果想对该项目进行二次开发的,不知道项目该如何编译,能否在README.md中补充这个内容,谢谢。

@TruthHun
Copy link
Owner

TruthHun commented Mar 5, 2018

程序是用Go语言框架beego开发的,关于二次开发等相关文档手册,会争取在这段时间补全。

@TruthHun
Copy link
Owner

TruthHun commented Mar 5, 2018

先简单说下编译。
在配置了Go开发环境的前提下,先安装bee工具:

go get github.com/beego/bee

bee使用:https://beego.me/docs/install/bee.md

使用以下方式进行拉取项目:

go get -v github.com/TruthHun/BookStack

不用git clone的方式,是为了避免项目存放路径不正确导致无法执行编译。
然后执行以下命令:

cd 你的Go Path目录/src/github/TruthHun/BookStack

接着执行bee run,然后看看程序报错,提示缺少啥go包,再用go get的方式安装即可。

@aizaimenghuangu
Copy link
Author

go get -v github.com/TruthHun/BookStack 会有如下提示,不知道是什么原因

github.com/TruthHun/BookStack (download)
package github.com/TruthHun/BookStack/models/store: cannot find package "github.com/TruthHun/BookStack/models/store" in any of:
/usr/local/Cellar/go/1.10/libexec/src/github.com/TruthHun/BookStack/models/store (from $GOROOT)
/usr/local/Cellar/go/1.10/src/github.com/TruthHun/BookStack/models/store (from $GOPATH)

@TruthHun
Copy link
Owner

TruthHun commented Mar 6, 2018

刚看了下,确实少了models/store目录下的源码,可能是在开发的时候忘记add里面的源码到git里面一起commit了,我今晚下班回去再重新push上来。更新上来之后再跟你说下,现在暂时先不要做二次开发,源码不完整,疏忽了,抱歉。

@TruthHun
Copy link
Owner

TruthHun commented Mar 6, 2018

现在已经把缺失的这两个代码文件更新上来了,是之前配置的.gitignore导致的问题。你再重新试一下。

@aizaimenghuangu
Copy link
Author

完美编译,感谢!同时附上 go get golang.org/x 包失败解决方法

由于限制问题,国内使用 go get 安装 golang 官方包可能会失败,如我自己在安装 collidermain 时,出现了以下报错:

$ go get collidermain
package golang.org/x/net/websocket: unrecognized import path "golang.org/x/net/websocket" (https fetch: Get https://golang.org/x/net/websocket?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

不翻墙的情况下怎么解决这个问题?其实 golang 在 github 上建立了一个镜像库,如 https://github.com/golang/net 即是 https://golang.org/x/net 的镜像库

获取 golang.org/x/net 包,其实只需要以下步骤:

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git

其它 golang.org/x 下的包获取皆可使用该方法
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.9.1
2018/03/09 17:41:17 INFO     ▶ 0001 Using 'BookStack' as 'appname'
2018/03/09 17:41:17 INFO     ▶ 0002 Initializing watcher...
2018/03/09 17:41:20 SUCCESS  ▶ 0003 Built Successfully!
2018/03/09 17:41:20 INFO     ▶ 0004 Restarting 'BookStack'...
2018/03/09 17:41:20 SUCCESS  ▶ 0005 './BookStack' is running...
2018/03/09 17:41:21 载入sego词典 /usr/local/Cellar/go/1.10/src/github.com/TruthHun/BookStack/dictionary/dictionary.txt
MinDoc version =>
build time =>
start directory => ./BookStack

2018/03/09 17:41:21 [I] [asm_amd64.s:2361] http server Running on http://:8181
2018/03/09 17:41:24 sego词典载入完毕

@tlchun
Copy link

tlchun commented Oct 28, 2019

2019/10/28 16:02:14 [INFO] Uses 'BookStack' as 'appname'
2019/10/28 16:02:14 [INFO] Initializing watcher...
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/commands)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/commands/daemon)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/commands/migrate)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/conf)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/controllers)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/controllers/api)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/graphics)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/models)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/models/store)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/oauth)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/routers)
2019/10/28 16:02:14 [TRAC] Directory(F:\GoProject\src\github.com\TruthHun\BookStack/utils)
2019/10/28 16:02:14 [INFO] Start building...

github.com/TruthHun/gotil/mdtil

..\gotil\mdtil\md2html.go:9:9: undefined: blackfriday.Run

github.com/TruthHun/html2json/html2json

..\html2json\html2json\html2json.go:58:23: undefined: blackfriday.Run

golang.org/x/sys/windows

......\golang.org\x\sys\windows\dll_windows.go:21:6: missing function body
......\golang.org\x\sys\windows\dll_windows.go:24:6: missing function body
2019/10/28 16:02:28 [ERRO] ============== Build failed ===================

@tlchun
Copy link

tlchun commented Oct 28, 2019

请问这个是什么原因引起的,谢谢

@tlchun
Copy link

tlchun commented Oct 28, 2019

完美编译,感谢!同时附上 go get golang.org/x 包失败解决方法

由于限制问题,国内使用 go get 安装 golang 官方包可能会失败,如我自己在安装 collidermain 时,出现了以下报错:

$ go get collidermain
package golang.org/x/net/websocket: unrecognized import path "golang.org/x/net/websocket" (https fetch: Get https://golang.org/x/net/websocket?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

不翻墙的情况下怎么解决这个问题?其实 golang 在 github 上建立了一个镜像库,如 https://github.com/golang/net 即是 https://golang.org/x/net 的镜像库

获取 golang.org/x/net 包,其实只需要以下步骤:

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git

其它 golang.org/x 下的包获取皆可使用该方法
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.9.1
2018/03/09 17:41:17 INFO     ▶ 0001 Using 'BookStack' as 'appname'
2018/03/09 17:41:17 INFO     ▶ 0002 Initializing watcher...
2018/03/09 17:41:20 SUCCESS  ▶ 0003 Built Successfully!
2018/03/09 17:41:20 INFO     ▶ 0004 Restarting 'BookStack'...
2018/03/09 17:41:20 SUCCESS  ▶ 0005 './BookStack' is running...
2018/03/09 17:41:21 载入sego词典 /usr/local/Cellar/go/1.10/src/github.com/TruthHun/BookStack/dictionary/dictionary.txt
MinDoc version =>
build time =>
start directory => ./BookStack

2018/03/09 17:41:21 [I] [asm_amd64.s:2361] http server Running on http://:8181
2018/03/09 17:41:24 sego词典载入完毕

好像没生成数据库

@aizaimenghuangu
Copy link
Author

数据库通过命令行导入:./BookStack install

@hugetiny
Copy link

go get -v github.com/TruthHun/BookStack
拉完没报错,但是目录是空的咋回事

@chorylee
Copy link

chorylee commented Apr 9, 2020

先简单说下编译。
在配置了Go开发环境的前提下,先安装bee工具:

go get github.com/beego/bee

bee使用:https://beego.me/docs/install/bee.md

使用以下方式进行拉取项目:

go get -v github.com/TruthHun/BookStack

不用git clone的方式,是为了避免项目存放路径不正确导致无法执行编译。
然后执行以下命令:

cd 你的Go Path目录/src/github/TruthHun/BookStack

接着执行bee run,然后看看程序报错,提示缺少啥go包,再用go get的方式安装即可。

这里的go语言环境,具体是哪个版本的golang,还是说对版本没有限制?

@zhongyue1q
Copy link

您好,请问下这个问题怎么解决。

360截图20200418154725455

@zhongyue1q
Copy link

@tlchun
请问这个问题怎么解决?
github.com/TruthHun/gotil/mdtil
..\gotil\mdtil\md2html.go:9:9: undefined: blackfriday.Run

github.com/TruthHun/html2json/html2json
..\html2json\html2json\html2json.go:58:23: undefined: blackfriday.Run

@hike2008
Copy link

!truth!hun/!book!stack@v1.3.1/controllers/AcountController.go:562:20: assignment mismatch: 2 variables but gocaptcha.NewCaptchaImage returns 1 values
!truth!hun/!book!stack@v1.3.1/controllers/BookController.go:1030:14: undefined: blackfriday.MarkdownCommon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants