Grpc-gateway: error:protoc-gen-grpc-gateway: program not found or is not executable

Created on 1 Aug 2016  路  4Comments  路  Source: grpc-ecosystem/grpc-gateway

got error when run the following cmd:
"protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true:. ./helloworld.proto"
ERROR INFO:
"protoc-gen-grpc-gateway: program not found or is not executable
--grpc-gateway_out: protoc-gen-grpc-gateway: Plugin failed with status code 1."

question

Most helpful comment

Can you confirm that protoc-gen-grpc-gateway is in a folder that is on your path?

What is the output of which protoc-gen-grpc-gateway?

protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --plugin=protoc-gen-grpc-gateway=$GOPATH/bin/protoc-gen-grpc-gateway  --grpc-gateway_out=logtostderr=true:. ./helloworld.proto

This presumes that your gopath is configured correctly. If not, make --plugin=protoc-gen-grpc-gateway= point to your actual protoc-grpc-gateway binary.

All 4 comments

Can you confirm that protoc-gen-grpc-gateway is in a folder that is on your path?

What is the output of which protoc-gen-grpc-gateway?

protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --plugin=protoc-gen-grpc-gateway=$GOPATH/bin/protoc-gen-grpc-gateway  --grpc-gateway_out=logtostderr=true:. ./helloworld.proto

This presumes that your gopath is configured correctly. If not, make --plugin=protoc-gen-grpc-gateway= point to your actual protoc-grpc-gateway binary.

Thank you, I tried your cmd, it worked.

@achew22 , I tried your cmd, no error. but the xxx.pb.go file still not generated.

protoc-gen-grpc-gateway creates the grpc-gateway files, xxx.pb.go files are created by protoc-gen-go. Hope that helps!

Was this page helpful?
0 / 5 - 0 ratings