Having the same issue that https://github.com/rbenv/rbenv/issues/622 describes. I'm trying to use ruby installed from asdf with SublimeLinter rubocop
@cmckni3 Thanks for reporting. I'll look into it today.
Same problem here. Any progress?
I've taken a look at this and here are my findings:
ruby -S irb #=> no Ruby script found in input (LoadError)ruby --help the -S switch "look(s) for the script using PATH environment variable"$HOME/.asdf/bin:/$HOME/.asdf/shimsirb it tries to invoke is the shim located in /Users/your_username/.asdf/shims$HOME/.asdf/shims/irb is not a ruby script, it's a batch script -- as a shim it will call asdf-exec to execute the script against the version of ruby specified in .tool-versions#!/usr/bin/env ruby), it results in the error no Ruby script found in input (LoadError)irb, from the installed ruby e.g. $HOME/.asdf/installs/ruby/2.3.2/binI've come up with a solution that resolves the error, but unsure if this is the direction you would like to take. I've simply prepended the install_path of the desired ruby version to PATH at the end of $HOME/.asdf/plugins/ruby/bin/exec-env. This is the line I appended:
export PATH=$install_path/bin:$PATH
The path could be prepended conditionally based on the -S switch being present. If this is acceptable solution I'm happy to create a PR for https://github.com/asdf-vm/asdf-ruby. Please let me know.
@nicholasjhenry this work for me. Thanks a lot.
Just found this issue when trying to run rake cucumber on a Rails project. Got around it meanwhile running cucumber directly without rake.
Hi,
Please can someone kindly provide an update with regards to this issue?
The workaround suggested by @nicholasjhenry works perfectly well for me but I really don't like have to hack installed files in this way.
Given this was raised around 3 months ago can I be so bold as to suggest you either accept a pull request or you close this issue.
Keep up the fantastic work though - asdf is a fantastic tool!
Thanks.
Most helpful comment
I've taken a look at this and here are my findings:
ruby -S irb #=> no Ruby script found in input (LoadError)ruby --helpthe-Sswitch "look(s) for the script using PATH environment variable"$HOME/.asdf/bin:/$HOME/.asdf/shimsirbit tries to invoke is the shim located in/Users/your_username/.asdf/shims$HOME/.asdf/shims/irbis not a ruby script, it's a batch script -- as a shim it will callasdf-execto execute the script against the version of ruby specified in.tool-versions#!/usr/bin/env ruby), it results in the errorno Ruby script found in input (LoadError)irb, from the installed ruby e.g.$HOME/.asdf/installs/ruby/2.3.2/binI've come up with a solution that resolves the error, but unsure if this is the direction you would like to take. I've simply prepended the install_path of the desired ruby version to
PATHat the end of$HOME/.asdf/plugins/ruby/bin/exec-env. This is the line I appended:The path could be prepended conditionally based on the
-Sswitch being present. If this is acceptable solution I'm happy to create a PR for https://github.com/asdf-vm/asdf-ruby. Please let me know.