Exception! Connection refused - send(2)

Hi!

I’m trying to create a setup with Sonic Pi and I run into errors. Here’s what I’m trying to do:

I have verified that I can have sound output of the pi (speaker-test), but I can’t get sound from Sonic Pi. When I run some code (which I know works well on another Sonic Pi install), I get no sound, but these errors appear in the journal:

Apr 25 20:11:27 sonicpi ruby[395]: Exception!
Apr 25 20:11:27 sonicpi ruby[395]: Connection refused - send(2)
Apr 25 20:11:27 sonicpi ruby[395]: ["/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/bin/sonic-pi-server.rb:613:in `block in <main>'"]
Apr 25 20:11:27 sonicpi ruby[395]: Exception!
Apr 25 20:11:27 sonicpi ruby[395]: Connection refused - send(2)
Apr 25 20:11:27 sonicpi ruby[395]: ["/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/bin/sonic-pi-server.rb:615:in `block in <main>'"]
Apr 25 20:11:27 sonicpi ruby[395]: Exception!
Apr 25 20:11:27 sonicpi ruby[395]: Connection refused - send(2)
Apr 25 20:11:27 sonicpi ruby[395]: ["/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/lib/sonicpi/osc/udp_client.rb:31:in `send'", "/usr/lib/sonic-pi/app/server/ruby/bin/sonic-pi-server.rb:615:in `block in <main>'"]

This just repeats as long as the code is running. If I stop the playback the errors also stop.

I have been troubleshooting this but can’t seem to figure out what is happening. Is there anyone that can point me in the right direction? The only pointer that I have is from line 613 of sonic-pi-server.rb, that reads:

gui.send("/incoming/osc", message[:time], message[:id], message[:address], message[:args])

Which leads me to think I might need to install a GUI for this to work. I would rather not though since this Pi will not have display outputting anywhere… should it be possible to run Sonic Pi headless like this?