I'm writing a ruby script to bootstrap a new macbook computer. I installed chruby
and ruby-install
via homebrew. If I call chruby
from the command line it works.
$ chruby
* ruby-2.4.1
But if I call it from a ruby script like so.
def failing_function
`chruby`
end
failing_function
I get this error
No such file or directory - chruby (Errno::ENOENT)
As a test I tried this
def successful_function
`ruby-install`
end
successful_function
And I get the same output for ruby-install
in the script as I do the command line.
Anyone have any ideas of what I'm doing wrong?