# From Ruby to Elixir: example\_server.ex code not working (page 74)

**URL:** <https://forum.devtalk.com/t/from-ruby-to-elixir-example-server-ex-code-not-working-page-74/112389>\
**Category:** PragProg Customers\
**Tags:** book-from-ruby-to-elixir, errata\
**Created:** [11 June 2023 02:09 UTC](https://forum.devtalk.com/t/from-ruby-to-elixir-example-server-ex-code-not-working-page-74/112389 "2023-06-11T02:09:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dharmamike](https://forum.devtalk.com/user_avatar/forum.devtalk.com/dharmamike/32/538_2.png) [@dharmamike](https://forum.devtalk.com/u/dharmamike)\
**Post date:** [11 June 2023 02:09 UTC](https://forum.devtalk.com/t/from-ruby-to-elixir-example-server-ex-code-not-working-page-74/112389/1 "2023-06-11T02:09:07Z")

</div>

### @sb8244

The code example for `Examples.GenServer.SimpleServer.add/3` function does not work for me as written. I was able to get it to work by switching the function arguments so that the `server` was the first argument rather than the last.

---

<div class="post-metadata">

**Author:** ![sb8244](https://forum.devtalk.com/user_avatar/forum.devtalk.com/sb8244/32/209_2.png) [@sb8244](https://forum.devtalk.com/u/sb8244)\
**Post date:** [12 June 2023 14:13 UTC](https://forum.devtalk.com/t/from-ruby-to-elixir-example-server-ex-code-not-working-page-74/112389/2 "2023-06-12T14:13:34Z")

</div>

I see the issue here. In the command line demo, I put pid first instead of last. Here’s a switched version:

 ![image](https://forum.devtalk.com/uploads/default/original/2X/2/2cce28c67b200d711878eb4317b8c49635a19942.png)

I like to put the pid as the last argument because it’s often left optional when using named processes. This is because you will often pass the pid in test file but not in your app. Happy to go into more detail if needed.

---

<div class="post-metadata">

**Author:** ![dharmamike](https://forum.devtalk.com/user_avatar/forum.devtalk.com/dharmamike/32/538_2.png) [@dharmamike](https://forum.devtalk.com/u/dharmamike)\
**Post date:** [13 June 2023 10:45 UTC](https://forum.devtalk.com/t/from-ruby-to-elixir-example-server-ex-code-not-working-page-74/112389/3 "2023-06-13T10:45:43Z")

</div>

:facepalm: This makes perfect sense. Thank you!
