Hi,
I’m trying to run an rb file from command line. I tried sonic-pi FILENAME.rb but no joy.
I’m on V4.6
Any help would be greatly appreciated (obvs!)
Hi,
I’m trying to run an rb file from command line. I tried sonic-pi FILENAME.rb but no joy.
I’m on V4.6
Any help would be greatly appreciated (obvs!)
Hi ! Actually, there is a “Direct” button in Sonic Pi, and inside that, there is another “Load” button. To run your .rb file, you need to open Sonic Pi, click on the “Direct” button, then use the “Load” button to load your file. After that, you can click “Run” to execute the script.
So, the process is: open Sonic Pi → click “Direct” → click “Load” to select your .rb file → then click “Run”.
This is why running sonic-pi FILENAME.rb directly from the command line doesn’t work — the app requires you to load the file through its interface first.
I hope this helps! Sonic Pi’s interface can be a bit tricky at first, but you’ll get the hang of it quickly.