搭建go开发环境时,出现GoSublime error: MarGo build failed的问题

来源:互联网 发布:csgo残局 知乎 编辑:程序博客网 时间:2024/04/25 18:57

在安装问go语言开发工具,Sublime Text Build 3083之后,再安装gocode和margo时,在安装margo那一步卡住了,出现了以下问题:


GoSublime error: MarGo build failed|                > This is possibly a bug or miss-configuration of your environment.|                > For more help, please file an issue with the following build output|                > at: https://github.com/DisposaBoy/GoSublime/issues/new|                > or alternatively, you may send an email to: gosublime@dby.me|                > |                > |                > cmd: `['D:\\Program Files\\Go\\bin\\go.exe', 'build', '-v', '-x', '-o', 'gosublime.margo_r14.12.06-1_go1.4.2.exe', 'gosubli.me/margo']`|                > stdout: ``|                > stderr: `WORK=~\AppData\Local\Temp\go-build300617651|                > runtime|                > go build runtime: windows/amd64 must be bootstrapped using make.bat`|                > exception: `None`|   install state: busy| sublime.version: 3083| sublime.channel: stable|       about.ann: a14.02.25-1|   about.version: r14.12.06-1|         version: r14.12.06-1|        platform: windows-x64|            ~bin: D:\software\sublime text\Sublime Text Build 3083 x64\Data\Packages\User\GoSublime\windows-x64\bin|       margo.exe: ~bin\gosublime.margo_r14.12.06-1_go1.4.2.exe (missing)|          go.exe: D:\Program Files\Go\bin\go.exe (ok)|      go.version: go1.4.2|          GOROOT: D:\Program Files\Go|          GOPATH: H:/go/development|           GOBIN: (not set) (should usually be `(not set)`)|       set.shell: []|       env.shell: |       shell.cmd: ['C:\\Windows\\system32\\cmd.exe', '/C', '${CMD}']


关键在于:
MarGo build failed
go get github.com/DisposaBoy/MarGo 之后才知道,这个工具已经被作者清理了,因此在github上搜索 MarGo之后,有几个结果


我选择了第一个搜索结果,(安装完之后可以使用但是和原来的MarGo的具体区别还没研究),可以使用这句语句在命令行输入go get github.com/slene/margo来安装


,安装完成之后在GOPATH目录下的bin文件夹会生成margo.exe的可执行文件,再将该可执行文件拷贝到Sublime Text 3083安装路径Data\Packages\User\GoSublime\windows-x64\bin下,并将文件名改为以下标为红色字的名字

<pre name="code" class="plain">               > cmd: `['D:\\Program Files\\Go\\bin\\go.exe', 'build', '-v', '-x', '-o', '<span style="color:#ff0000;">gosublime.margo_r14.12.06-1_go1.4.2.exe</span>', 'gosubli.me/margo']`

以下是我的电脑上的路径,仅供参考


重新启动sublime Text 3083即可



0 0
原创粉丝点击