Tim Emiola | eb158ff | 2015-02-21 06:29:53 -0800 | [diff] [blame] | 1 | gRPC in 3 minutes (Ruby) |
| 2 | ======================== |
Tim Emiola | 49f3ccd | 2015-02-19 11:09:19 -0800 | [diff] [blame] | 3 | |
Tim Emiola | eb158ff | 2015-02-21 06:29:53 -0800 | [diff] [blame] | 4 | PREREQUISITES |
| 5 | ------------- |
Tim Emiola | 49f3ccd | 2015-02-19 11:09:19 -0800 | [diff] [blame] | 6 | |
Tim Emiola | eb158ff | 2015-02-21 06:29:53 -0800 | [diff] [blame] | 7 | This requires Ruby 2.1, as the gRPC API surface uses keyword args. |
Tim Emiola | 49f3ccd | 2015-02-19 11:09:19 -0800 | [diff] [blame] | 8 | |
Tim Emiola | 5b5e146 | 2015-02-25 04:18:56 -0800 | [diff] [blame^] | 9 | If you don't have that installed locally, you can use [RVM](https://www.rvm.io/) to use Ruby 2.1 for testing without upgrading the version of Ruby on your whole system. |
| 10 | ```sh |
| 11 | $ command curl -sSL https://rvm.io/mpapis.asc | gpg --import - |
| 12 | $ \curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby-2.1 |
| 13 | $ |
| 14 | $ # follow the instructions to ensure that your're using the latest stable version of Ruby |
| 15 | $ # and that the rvm command is installed |
| 16 | ``` |
| 17 | - Make sure your run `source $HOME/.rvm/scripts/rvm` as instructed to complete the set up of RVM |
| 18 | |
Tim Emiola | 49f3ccd | 2015-02-19 11:09:19 -0800 | [diff] [blame] | 19 | INSTALL |
| 20 | ------- |
| 21 | |
| 22 | - Clone this repository. |
| 23 | - Follow the instructions in [INSTALL](https://github.com/grpc/grpc/blob/master/INSTALL) to install the gRPC C core. |
Tim Emiola | eb158ff | 2015-02-21 06:29:53 -0800 | [diff] [blame] | 24 | - *Temporary* Install the full gRPC distribution from source on your local machine and update path: in [Gemfile] to refer src/ruby within it. |
| 25 | - this is necessary until the gRPC ruby gem is published |
Tim Emiola | 49f3ccd | 2015-02-19 11:09:19 -0800 | [diff] [blame] | 26 | - Use bundler to install |
| 27 | ```sh |
| 28 | $ # from this directory |
| 29 | $ gem install bundler && bundle install |
| 30 | ``` |
| 31 | |
Tim Emiola | eb158ff | 2015-02-21 06:29:53 -0800 | [diff] [blame] | 32 | Try it! |
| 33 | ------- |
Tim Emiola | 49f3ccd | 2015-02-19 11:09:19 -0800 | [diff] [blame] | 34 | |
| 35 | - Run the server |
| 36 | ```sh |
| 37 | $ # from this directory |
| 38 | $ bundle exec ./greeter_server.rb & |
| 39 | ``` |
| 40 | |
| 41 | - Run the client |
| 42 | ```sh |
| 43 | $ # from this directory |
| 44 | $ bundle exec ./greeter_client.rb |
| 45 | ``` |