elixir-protobuf / protobuf

A pure Elixir implementation of Google Protobuf.
https://hexdocs.pm/protobuf/readme.html
MIT License
823 stars 143 forks source link

Error trying to find proto file #69

Closed emmy0x1 closed 5 years ago

emmy0x1 commented 5 years ago

I have my proto file in on the top level of my directory. When I run this: protoc --elixir_out=./lib rpc.proto, I get the following error:

Please specify a program using absolute path or make sure the program is available in your PATH system variable
--elixir_out: protoc-gen-elixir: Plugin failed with status code 1.

I've tried many variations of appending to my path without luck. The latest one is: export PATH=/Users/emmyalmaraz/.mix/escripts/bin:$PATH

whatyouhide commented 5 years ago

@ealmz how did you install protobuf-elixir?

emmy0x1 commented 5 years ago

I'm on macOS. brew install protobuf and then mix escript.install hex protobuf

whatyouhide commented 5 years ago

@ealmz once you do that, do you have ~/.mix/escripts/protoc-gen-elixir available? The bin part shouldn't be there.

emmy0x1 commented 5 years ago

It installs in here /Users/emmyalmaraz/.asdf/installs/elixir/1.9.1/.mix/escripts/protoc-gen-elixir

Should I put that in my path instead? Sorry I don't have a ton of experience with environment variables.

whatyouhide commented 5 years ago

You should have ~/.asdf/shims in the path, then make sure that you install mix escript.install hex protobuf in the current version you're using and then call asdf reshim.

emmy0x1 commented 5 years ago

The only thing I did was asdf reshim and it worked. Thank you!