Ads Generator for Ruby

Create Ruby clients from a protocol buffer description of an API.

Note This project is a preview. Please try it out and let us know what you think, but there are currently no guarantees of stability or support.


Install the Proto Compiler

This generator relies on the Protocol Buffer Compiler to orchestrate the client generation.

# Declare the protobuf version to use.
$ export PROTOBUF_VERSION=3.6.1

# Declare the target installation system.
# export SYSTEM=osx
$ export SYSTEM=linux

# Get the precompiled protobuf compiler.
$ curl --location${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION} > usr/src/protoc/protoc-${PROTOBUF_VERSION}.zip
$ cd /usr/src/protoc/
$ unzip protoc-${PROTOBUF_VERSION}.zip
$ rm protoc-${PROTOBUF_VERSION}.zip

# Link the protoc to the path.
$ ln -s /usr/src/protoc/bin/protoc /usr/local/bin/protoc
$ mkdir -p /protos/

# Move the common protobuf files to the local include folder.
$ cp -R /usr/src/protoc/include/* /usr/local/include/

Build and Install the Generator

This tool is in pre-alpha so it is not yet released to RubyGems. You will have to build the generator from scratch.

$ git clone
$ cd gapic-generator-ruby
$ gem build gapic-generator.gemspec
$ gem install gapic-generator-0.1.0.gem
$ which protoc-gen-ruby_gapic
> {Non-empty path}

Generate an API

Installing this generator exposes protoc-gen-ruby_gapic on the PATH. By doing so, it gives the protobuf compiler the CLI option --ruby_gapic_out on which you can specify an output path for this generator.

If you want to experiment with an already-existing API, one example is available. Note: You need to clone the googleapis repository from GitHub, and change to a special branch:

# Get the protos and it's dependencies.
$ git clone
$ git clone
$ cd googleapis
$ git checkout --track -b input-contract origin/input-contract

# Now you're ready to compile the API.
$ protoc google/ads/vision/v1/*.proto \
    --proto_path=../api-common-protos/ --proto_path=. \