If you put all the tools together, Ruby's Bundler and name will be affected.

Asked 2 years ago, Updated 2 years ago, 80 views

When I first installed Go, I did go get-u golang.org/x/tools/... to install all the tools that editors would use for static analysis, such as gorename and goimports.

Recently, I started using Ruby, and I realized that both golang.org/x/tools/cmd/bundle and Ruby's Bundler command names are bundle.According to the issue on the Go side, there seems to be no intention of fixing this: https://github.com/golang/go/issues/23700.The $GOPATH/bin is the first PATH in my environment, so the bundle command calls the bundle of Go

.

There is also a solution that involves playing with PATH's order or installing Go tools individually rather than in bulk, but it's a bit troublesome. (PATH is also compatible with other tools...)

I won't use Go's bundle for the time being, so is there a way to make Ruby's Bundler look good?

environment:macOS Catalina

*I'm answering myself, but I'd like to know if there is a more convenient way to build an environment.

ruby go bundler

2022-09-29 22:22

2 Answers

After installing Go tools in bulk, only the bundle will be uninstalled, so there seems to be no problem.

go clean-i golang.org/x/tools/cmd/bundle


2022-09-29 22:22

direnv may allow you to "prepend PATH valid only in certain directories."

Example: In .envrc,

PATH_add "/path/to/bin/dir"

For this .envrc,

I don't know what's going on and how the above is being realized.

In addition, .envrc is just a shell executable, so there is an atmosphere where you can organize it arbitrarily.


2022-09-29 22:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.