Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ruby included with Sonic Pi for start-server #18

Open
yaychris opened this issue May 12, 2017 · 2 comments
Open

Use Ruby included with Sonic Pi for start-server #18

yaychris opened this issue May 12, 2017 · 2 comments

Comments

@yaychris
Copy link
Contributor

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 :(

@lpil
Copy link
Owner

lpil commented May 12, 2017

This is great, thanks Chris.

Would you like to send over a PR with as far as you've got and then we can see if we can resolve the Rust tricky-ness. You've done work here, so it'd be nice for you to get a contribution in the repo :)

Probably only need to prepend the sandboxed ruby path to the command and ignore the shebang?

@fwinokur
Copy link

fwinokur commented Feb 23, 2019

Great project, thank you for your work! Leaving this note in case anyone runs into a similar issue as I. I experienced something similar to what is described in this Issue and I resolved it by upgrading my Ruby system install to 2.5.x given how the Sonic Pi dependencies seem to resolve (it appears 2.4.x will work too). There wasn't support for my default macOS Mojave Ruby install of 2.3.7 or the most recent stable Ruby version (2.6.3 as of the time of this writing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants