【问题标题】:Twirp not working with protoTwirp 不适用于原型
【发布时间】:2018-07-16 16:27:30
【问题描述】:

我似乎无法正确安装 twirp 以使用 protobuf。

protoc --proto_path=$GOPATH/bin:. --twirp_out=. --go_out=. ./rpc/person/service.proto

是我在编译和创建我的 twirp 文件时尝试执行的命令,但是我收到以下错误:

protoc-gen-twirp:program not found or is not executable
--twirp_out: protoc-gen-twirp: Plugin failed with status code 1.

我的 .bashrc 已经为 Golang 准备了这两行代码:

export GOPATH=/home/carlosrueda/Documents/go
PATH=$PATH:/usr/local/bin/go/bin:$GOPATH

任何解决此问题的帮助将不胜感激,谢谢。

【问题讨论】:

  • 你在PATH=之前忘记了export
  • 我试过了,还是不行。
  • 在您的控制台中输入 which protoc-gen-twirp。如果它不输出任何内容,则说明在您的 PATH 中未检测到二进制文件。
  • 确实没有输出,我该如何解决这个问题?
  • 我通过在 .bashrc 的第二行末尾添加 /bin 来解决此问题。 PATH=$PATH:/usr/local/bin/go/bin:$GOPATH/bin

标签: go protocol-buffers proto twirp


【解决方案1】:

我通过在 .bashrc 的第二行末尾添加 /bin 来解决此问题。 PATH=$PATH:/usr/local/bin/go/bin:$GOPATH/bin

【讨论】:

    猜你喜欢
    • 2011-12-03
    • 2014-09-21
    • 1970-01-01
    • 2023-02-10
    • 1970-01-01
    • 2011-04-30
    • 1970-01-01
    • 1970-01-01
    • 2010-10-19
    相关资源
    最近更新 更多