Search code examples
ruby-on-railsrubyrubygemsrvmgemset

Gemset error when updating to Ruby 2.4.2


I'm updating from Ruby 2.0 to 2.4.2 using RVM, and receive the following error messages during an install using $ rvm install ruby-2.4.2:

Making gemset ruby-2.4.2 pristine - please wait

'command gem pristine --extensions bigdecimal --version 1.3.0 gem-wrappers --version 1.3.2 io-console --version 0.4.6 json --version 2.0.4 openssl --version 2.0.5 psych --version 2.2.2' failed, you need to fix this gems manually.
Error running '__rvm_with ruby-2.4.2 gemset_pristine',
please read /Users/myname/.rvm/log/1507820191_ruby-2.4.2/gemset.pristine-ruby-2.4.2.log

Making gemset ruby-2.4.2@global pristine - please wait

'command gem pristine --extensions bigdecimal --version 1.3.0 io-console --version 0.4.6 json --version 2.0.4 openssl --version 2.0.5 psych --version 2.2.2' failed, you need to fix this gems manually.
Error running '__rvm_with ruby-2.4.2@global gemset_pristine',
please read /Users/myname/.rvm/log/1507820191_ruby-2.4.2/gemset.pristine-ruby-2.4.2@global.log

I'm… not quite sure what this means, or what I should do next. Any thoughts? I'm running macOS 10.12.6.

[Edit]: Here's a copy of the error log.


Solution

  • Found a fix as referenced in this RVM GitHub issue that involves installing zlib using brew and then re-installing ruby while pointing to that zlib directory. As someone in that thread pointed out, this shouldn't be necessary. Still not sure why the problem arose.

    Steps

    $ brew install zlib
    $ rvm remove 2.4.2
    $ rvm install 2.4.2 —-with-zlib-dir=/usr/local/Cellar/zlib/1.2.11