weaver icon indicating copy to clipboard operation
weaver copied to clipboard

Unable to install to the mac after go install

Open erqiu-sj opened this issue 3 years ago • 10 comments

This framework makes me very excited to see the trend of unification, but I have encountered problems in installation

This is my go env configuration

GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/Users/devops/Library/Caches/go-build" GOENV="/Users/devops/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/devops/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/devops/go" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.19.5" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/devops/go/src/serviceweaver/go.mod" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lk/k280wks50hv_1zt5y1lmrlhw0000gn/T/go-build3603867559=/tmp/go-build -gno-record-gcc-switches -fno-common"

Here are my actions

go install github.com/ServiceWeaver/weaver/cmd/weaver@latest

in .bashrc and .bash_profile

export PATH="$PATH:$GOPATH/bin"

source ~/(.bashrc | .bash_profile)

weaver --help

zsh: command not found: weaver

what more information do I need to provide?

erqiu-sj avatar Mar 06 '23 03:03 erqiu-sj

if you use zsh, you should source zshrc I believe, and also if you try on your ide/editor with weaver --help it should work flawless. @erqiu-sj

charles-chenzz avatar Mar 06 '23 06:03 charles-chenzz

如果你使用 zsh,我相信你应该获得 zshrc,而且如果你尝试使用你的 ide/editor,它weaver --help应该可以完美运行。@erqiu-sj

I tried and found that the result was the same. I think it was caused by the lack of weaver binaries in the go/bin directory after go install. When I ran go install again, I found that there was no prompt

erqiu-sj avatar Mar 06 '23 06:03 erqiu-sj

如果你使用 zsh,我相信你应该获得 zshrc,而且如果你尝试使用你的 ide/editor,它weaver --help应该可以完美运行。@erqiu-sj

I tried and found that the result was the same. I think it was caused by the lack of weaver binaries in the go/bin directory after go install. When I ran go install again, I found that there was no prompt

i don't know if it's caused by lack of binaries, but I know how to solve it lol. cus I used to happen on this issues too, but not from this project so I guess it's the same thing, anyway I think the problem is solved right?

charles-chenzz avatar Mar 06 '23 06:03 charles-chenzz

you might need to install GCC if you don't have it installed

yousuf64 avatar Mar 06 '23 07:03 yousuf64

@erqiu-sj The error message shows that the terminal you are using is zsh, but you set export PATH="$PATH:$GOPATH/bin" in the bash configuration.

jinrenjie avatar Mar 06 '23 07:03 jinrenjie

@erqiu-sj报错提示你使用的最终终端是 zsh,但是你export PATH="$PATH:$GOPATH/bin"在 bash 配置中设置的。

I also configured it in the. zshrc file....

erqiu-sj avatar Mar 06 '23 07:03 erqiu-sj

如果你没有安装 GCC,你可能需要安装它

gcc --version Apple clang version 14.0.0 (clang-1400.0.29.202) Target: arm64-apple-darwin22.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

is this one?

erqiu-sj avatar Mar 06 '23 07:03 erqiu-sj

do you see any errors when trying to build the ServiceWeaver project from the source using go build?

yousuf64 avatar Mar 06 '23 07:03 yousuf64

在尝试使用源代码构建 ServiceWeaver 项目时,您是否看到任何错误go build

I'll try it after work

erqiu-sj avatar Mar 06 '23 08:03 erqiu-sj

adding $GOPATH/bin to /etc/paths works fine for me :)

StartAgainJ avatar Mar 13 '23 03:03 StartAgainJ

Closing this issue, this seems to be a GOPATH issue, unless I'm mistaken. Feel free to re-open if I'm wrong.

spetrovic77 avatar Mar 15 '23 23:03 spetrovic77