sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.76k stars 922 forks source link

load_example fails on Ubuntu: "Error - no example found with name:" ... #1229

Closed nealmcb closed 8 years ago

nealmcb commented 8 years ago

load_example works on my Raspberry Pi 3. But it fails on Ubuntu, installed via http://ppa.launchpad.net/sonic-pi/ppa/ubuntu/ with version 2.10.0~repack-1~trusty3

I can still autocomplete fine. E.g. entering load_example and the space bar gives me a menu with e.g. :acid. But when I Run that, I get

 Error - no example found with name: :acid

On the Raspberry Pi 3 I find the examples in e.g. /opt/sonic-pi//etc/examples/magician/wob_rhyth.rb

I can't find the similar file anywhere on Ubuntu, including in the place that the code is looking in, /usr/lib/etc/examples, which doesn't seem like the right place anyway.

Puzzling....

rbnpi commented 8 years ago

Neal, I think there is a bug here. Confirm behaviour on Ubuntu that you find. For the record the Ubuntu install Sonic Pi does indeed use different locations for the example files, as it follows the the requirements Debian and Ubuntu to produe a ppa and utimately a .deb package for inclusion in the official repositories. SP works out the location internally. I think that if you enter and run puts etc_path+”/examples” it will give you the answer for the version you are running. On Mac and Pi it is /etc/examples where S is the top level folder sonic-pi, eg on Pi /home/pi/sonic-pi if self build, or opt/sonic-pi/etc if installed from apt-get install sonic-pi.on Ubuntu ppa it is /usr/lib/etc/examples As far as the examples are concerned, in the latest versions, they are arrange within the examples folder in category subfolders. If you look at the list in the Help examples section you will see that Acid is listed as [Magician] Acid It is located in examples/magician.acid.rb

You may find it instructive to study the relevant section in the file < sonic-pi>/app/server/bin/qt-doc.rb around lines 177-196 (in the latest version: May differ slightly ) which shows how the documented examples are built from the actual files used. Again in the Ubuntu ppa the locations are different. Hope this helps. Robin

On 16 May 2016, at 04:24, Neal McBurnett notifications@github.com wrote:

load_example works on my Raspberry Pi 3. But it fails on Ubuntu, installed via http://ppa.launchpad.net/sonic-pi/ppa/ubuntu/.

I can still autocomplete fine. E.g. entering load_example and the space bar gives me a menu with e.g. :acid. But when I Run that, I get

Error - no example found with name: :acid

On the Raspberry Pi 3 I find the examples in e.g. /opt/sonic-pi//etc/examples/magician/wob_rhyth.rb

I can't find the similar file anywhere on Ubuntu, including in the place that the code is looking in, /usr/lib/etc/examples, which doesn't seem like the right place anyway.

Puzzling....

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

hzulla commented 8 years ago

Thanks. I'll fix that for the Ubuntu package.

rbnpi commented 8 years ago

on investigation it looks like the ppa does NOT include the examples files, but merely the html versions in the help files. the load_examples command looks for the original examples files from which the html ones were produced, and since they are not there can't find them. I also have a build for Ubuntu which uses the original layout of files all within the sonic-pi home directory and this does work with the load_examples command. I think @hzulla will need to sort this out.

hzulla commented 8 years ago

Fixed with 2.10.0~repack-2 in Debian und Ubuntu. Thanks for reporting this.