我无法启动一个 Golang 服务器。

huangapple go评论72阅读模式
英文:

I can't start a golang server

问题

我下载了<https://github.com/Jhuster/RTCStartupDemo/tree/master/RTCSignalServer>。

现在我想在我的VPS上运行它,但我不知道该怎么做。
它是用Golang/go编写的。
所以我在我的Linux Ubuntu VPS上安装了go。
现在当我在目录中运行以下命令时:

source env.sh

make

它给我以下错误信息:

GOPATH = /RTCSignalServer
make[1]: 进入目录'/RTCSignalServer'
making for mac
pattern ./src/rtc.signal.com/app/...: directory prefix src/rtc.signal.com/app does not contain main module or its selected dependencies
make[1]: *** [Makefile:10: mac] Error 1
make[1]: 离开目录'/RTCSignalServer'
make: *** [Makefile:5: all] Error 2

现在我尝试在src/app/目录中创建一个main.go模块,但它仍然不起作用。
有人可以帮助我并给我应该运行的命令吗?
谢谢。

英文:

I downloaded <https://github.com/Jhuster/RTCStartupDemo/tree/master/RTCSignalServer>

Now I want to make this run on my VPS but I dont know how.
It is written in Golang/go.
So I installed go on my VPS in linux ubuntu.
Now when I run in the directory:

source env.sh

make

It gives me the following error message:

GOPATH = /RTCSignalServer
make[1]: Entering directory &#39;/RTCSignalServer&#39;
making for mac
pattern ./src/rtc.signal.com/app/...: directory prefix src/rtc.signal.com/app does not contain main module or its selected dependencies
make[1]: *** [Makefile:10: mac] Error 1
make[1]: Leaving directory &#39;/RTCSignalServer&#39;
make: *** [Makefile:5: all] Error 2

Now I tried to make a module of main.go in src/app/ directory but it still doesnt work.
Could someone please help me and give me the commands I should run?
Thank you.

答案1

得分: 1

谢谢,我按照以下方式构建它,并且它成功运行:

$ cd RTCSignalServer
$ go env -w GO111MODULE=off
$ source env.sh
$ make
英文:

Thank you I build it like this and it worked:

$ cd RTCSignalServer
$ go env -w GO111MODULE=off
$ source env.sh
$ make

huangapple
  • 本文由 发表于 2022年10月7日 00:22:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/73977128.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定