lpil / lpil/sonic-pi-tool

Use Ruby included with Sonic Pi for start-server

Open
#18 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
234
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Sonic Pi's server/bin/sonic-pi-server.rb has a shebang line for #!/usr/bin/env ruby. When running sonic-pi-tool start-server from the command line, it uses whatever ruby it finds in your PATH. If it's not 2.3 (the version bundled with Sonic Pi), it fails:

$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

$ sonic-pi-tool start-server
/Users/chris/Applications/Sonic Pi.app/app/server/vendor/fast_osc-0.0.11/lib/fast_osc.rb:22:in `require_relative': cannot load such file -- /Users/chris/Applications/Sonic Pi.app/app/server/rb-native/osx/2.4.0/fast_osc (LoadError)
        from /Users/chris/Applications/Sonic Pi.app/app/server/vendor/fast_osc-0.0.11/lib/fast_osc.rb:22:in `rescue in <top (required)>'
[omitted]

It's looking for files in Sonic Pi.app/app/server/rb-native/osx/2.4.0 instead of Sonic Pi.app/app/server/rb-native/osx/2.3.0.

It would be super cool if the start-server command, after determining the correct path to the Sonic Pi installation, started the server using the Ruby included in the package (Sonic Pi.app/app/server/native/osx/ruby/bin).

Again, as mentioned in #17, I'd gladly implement this but I don't have the Rust knowledge to make it happen :(

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Rust implementation of the start-server command and the logic that determines the Sonic Pi installation path. Check how it currently launches server/bin/sonic-pi-server.rb, then verify that it uses the packaged executable under Sonic Pi.app/app/server/native/osx/ruby/bin rather than ruby from PATH. Done means sonic-pi-tool start-server selects the bundled Ruby and avoids the version-specific LoadError.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.