Search code examples
ruby-on-railsrubyrvmmacos-sierra

rvm install fails with error: "__rvm_detect_max_threads:cd:21: string not in pwd: /***"


I just upgraded my macOs to Sierra, and trying to set it up. On trying to use rvm to install ruby, I'm getting this very weird error:

__rvm_detect_max_threads:cd:21: string not in pwd: /Users/sunday/workspace/contributions

I have only one folder in the directory /workspace/contributions and not knowing what the error is, tried to remove /workspace/contributions, but the error still persists.

On using the --debug option, following is the trace I have:

~ rvm reinstall --debug 2.2.0 --disable-binary
2.2.0 - reinstall
ruby-2.2.0 - #already removed src/ruby-2.2.0
ruby-2.2.0 - #already removed rubies/ruby-2.2.0
ruby-2.2.0 - #already removed src/ruby-2.2.0
ruby-2.2.0 - #already removed rubies/ruby-2.2.0
Free disk space 73467MB, required 440MB.
__rvm_setup_compile_environment_setup ruby-2.2.0
rvm_autolibs_flag=enable
__rvm_setup_compile_environment_movable_early ruby-2.2.0
__rvm_setup_compile_environment_system_early ruby-2.2.0
__rvm_setup_compile_environment_requirements ruby-2.2.0
Checking requirements for osx.
requirements code for osx loaded
requirements lib type set to osx_brew
brew seems to be writable
Found required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libksba, openssl.
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sunday/.rvm/bin
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/libyaml )
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/readline )
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/libksba )
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/openssl )
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
__rvm_setup_compile_environment_movable ruby-2.2.0
__rvm_setup_compile_environment_parse_name ruby-2.2.0
__rvm_setup_compile_environment_system ruby-2.2.0
__rvm_setup_compile_environment_architectures ruby-2.2.0
rvm_architectures(0):.
__rvm_setup_compile_environment_gcc47plus ruby-2.2.0
__rvm_setup_compile_environment_bison ruby-2.2.0
__rvm_setup_compile_environment_flags_docs ruby-2.2.0
__rvm_setup_compile_environment_flags_shared_static ruby-2.2.0
__rvm_setup_compile_environment_flags_threads ruby-2.2.0
__rvm_detect_max_threads:cd:21: string not in pwd: /Users/sunday/workspace/contributions
__rvm_rm_rf already gone: /Users/sunday/.rvm/tmp/6618*
➜  ~ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
➜  ~ 

This also happens when I try to use install instead of reinstall.

What can be happening here, and how can I get this resolved to install ruby on my machine?


Solution

  • Following this thread https://github.com/rvm/rvm/issues/3686 on Github, I was able to get it installed by using the command:

    rvm install ruby-2.3.1 --disable-binary -j 8
    

    According to the comment:

    So it seems like the "detect number of CPU threads" functionality is, for whatever reason, breaking it on my machine.