ruby-install icon indicating copy to clipboard operation
ruby-install copied to clipboard

macOS JRuby fails on cp with src dir

Open esotericpig opened this issue 2 years ago • 1 comments

(Sorry on mobile, so accidentally sent original bug without description.)

Description

On macOS if install JRuby like this:

$ mkdir temp
$ ruby-install -s temp jruby

Fails on copy_into function:

cp: temp/jruby-9.3.4.0/*: No such file or directory

I added a pwd to copy_into in util.sh, and I see that it actually CDed into that directory:

pwd
/Users/.../temp/jruby-9.3.4.0

So workaround is to use full, absolute path (instead of relative). Interestingly though, just using temp works for installing ruby.

Don't know if this is by design or not.

Environment

  • Darwin kernel v21.4.0
  • bash (not zsh)
  • ruby-install v0.8.3

esotericpig avatar May 03 '22 15:05 esotericpig

This is because bin/ruby-install cds into $src_dir/$ruby_dir_name. So if the src_dir is relative, it won't be able to find the $src_dir/$ruby_dir_name while within $src_dir/$ruby_dir_name. We could change the copy_into call to copy the current directory, or replace install_ruby of jruby with better logic that is specifically for installing binary or pre-compiled rubies.

postmodern avatar Jan 24 '23 02:01 postmodern