Evaluation code in a "release" not working when including spaces in code

I have a running release app and need to do some maintenance by running some Elixir code. This works fine when doing it through iex by calling bin/RELEASE remote and typing in the necessary code, but I want to streamline this proces by running the line of code using the rpc command (or the eval command, which gives the same issue).

Within bash, next to my release, if I try the following line it results in the error below:
RELEASE.sh eval "%{a: 1}"

** (SyntaxError) nofile:1:15: unexpected token: ":" (column 15, code point U+003A)

This seems to have something to do with the space being seen as a terminator but I have tried different ways of escaping it to no avail. I also tried with other lines and everything without spaces works fine, but with spaces gives the error. e.g.:

./release.sh rpc "'x'" ← seems to work
./release.sh rpc "' '" ← ** (TokenMissingError) nofile:1:2: missing terminator: ’

Any ideas how to get this to work?

Ditch the double quotes and only use single quotes around the Elixir code. You are fighting with your shell and its rules around quotes.

@dimitarvp Thanks for the answers but this is not the issue, I should have mentioned in the OP that I tried different quotes and escapes.

So this still does not work?

./release.sh rpc 'IO.puts("hello")'

That works fine, but
./release.sh rpc 'IO.puts("hello world")' doesn’t