0

My rvm version is 1.29.12 and macOS 11.2.3, here is the error messages.

Error running 'env GEM_HOME=/Users/yuanyuanliu/.rvm/gems/ruby-1.9.3-p551@global GEM_PATH= /Users/yuanyuanliu/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -d /Users/yuanyuanliu/.rvm/src/rubygems-2.7.9/setup.rb --no-document',
please read /Users/yuanyuanliu/.rvm/log/1618286479_ruby-1.9.3-p551/rubygems.install.log

then cat rubygems.install.log

Exception `LoadError' at /Users/yuanyuanliu/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/rubygems.rb:1264 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/yuanyuanliu/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/rubygems.rb:1273 - cannot load such file -- rubygems/defaults/ruby
/Users/yuanyuanliu/.rvm/src/rubygems-3.0.9/lib/rubygems/core_ext/kernel_require.rb:54:in `require': /Users/yuanyuanliu/.rvm/src/rubygems-3.0.9/lib/rubygems/core_ext/kernel_warn.rb:15: syntax error, unexpected tLABEL (SyntaxError)
    module_function define_method(:warn) {|*messages, uplevel: nil|
                                                              ^
/Users/yuanyuanliu/.rvm/src/rubygems-3.0.9/lib/rubygems/core_ext/kernel_warn.rb:18: void value expression
/Users/yuanyuanliu/.rvm/src/rubygems-3.0.9/lib/rubygems/core_ext/kernel_warn.rb:43: syntax error, unexpected '}', expecting keyword_end
    from /Users/yuanyuanliu/.rvm/src/rubygems-3.0.9/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/yuanyuanliu/.rvm/src/rubygems-3.0.9/lib/rubygems.rb:1390:in `<top (required)>'
    from setup.rb:28:in `require'
    from setup.rb:28:in `<main>'
'command gem pristine  --version ' failed, you need to fix these gems manually.
Error running '__rvm_with ruby-1.9.3-p551 gemset_pristine',
please read /Users/yuanyuanliu/.rvm/log/1618301825_ruby-1.9.3-p551/gemset.pristine-ruby-1.9.3-p551.log
Making gemset ruby-1.9.3-p551@global pristine - please wait

'command gem pristine  --version ' failed, you need to fix these gems manually.
Error running '__rvm_with ruby-1.9.3-p551@global gemset_pristine',
please read /Users/yuanyuanliu/.rvm/log/1618301825_ruby-1.9.3-p551/gemset.pristine-ruby-1.9.3-p551@global.log

Thanks in advance.

Sam
  • 1
  • 2
  • 1
    Please add to the question the commands you ran. Also note that Ruby 1.9 is beyond end-of-life, and no longer receives important updates. For instance, attempting to install Ruby 1.9 with RVM requires the deprecated libssl1.0-dev, which can put you at risk for severe security problems. – user513951 Apr 13 '21 at 17:17
  • 1
    I'm pretty sure RubyGems 3.0.9 (released December, 20th 2020) does not support Ruby 1.9.3-p551 (released November, 11th 2014). – Jörg W Mittag Apr 13 '21 at 20:10

1 Answers1

1

@Sam: a lot of users, like myself, are still running production systems on Ruby 1.9.3-p551 even though everyone screams EOL. Ignore them becuase the last I checked, my government (apparently most powerful in the world) is still running on 60 year old COBOL...LOL! Hey, if it's still making you money, why not?

Anyhow, I personally prefer using rbenv to manage my versions of Rubies. So, if you're able to use rbenv, you can follow my instructions below to get up and running with both rbenv and ruby-1.9.3-p551 securely patched with SSLv1, SSLv2, SSLv3 & TLSv1.2:

# 1. Update brew and install OpenSSL/rbenv
brew update
brew install openssl
brew install rbenv

# 2. Set up rbenv in your shell
rbenv init

# 3. Close your Terminal window and open a new one so your changes take effect
# 4. Verify that rbenv is properly set up using this rbenv-doctor script
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash

#  You should get a response with the following 2 last lines:
#  ----------------------------------------------------------
#> Checking RubyGems settings: OK
#> Auditing installed plugins: OK

# 5. Now, time to install Ruby 1.9.3-p551 w/ TLSv1_2 patch
# -- This process takes approx. 3-6mins on a Ubuntu 18.04 VPS
# -- Reference: https://niv.su/arch/ruby/2019/04/01/ruby1.9-openssl.html
rbenv install --force --patch 1.9.3-p551 < <(curl -sSL https://git.io/JOcZw)
# 6. Set, rbenv global and run rbenv rehash (optional)
rbenv global 1.9.3-p551
echo 'gem: --no-document' >> ~/.gemrc
rbenv rehash

# 7. Install Bunder version 1.17.3 as that is the only most recent supported 
# -- version with Ruby 1.9.3-p551
gem install bundler -v 1.17.3 --no-rdoc --no-ri
rbenv rehash

# 8. Locate your `bundle` executable and add require 'openssl' right below
# -- require 'rubygems' in that file
gem env | grep "EXECUTABLE DIRECTORY"
#> - EXECUTABLE DIRECTORY: /home/robby/.rbenv/versions/1.9.3-p551/bin
nano /home/robby/.rbenv/versions/1.9.3-p551/bin/bundle
# -- save, exit and run:
rbenv rehash
ruby -v
#> ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

# 9. At this point you should be all set and can run the following 
# -- command to ensure Ruby 1.9.3-p551 is successfully installed with the patch
curl -Lks 'https://git.io/rg-ssl' | ruby

# Your output should be similar to this except location directories for your SSL files
# -----------------------------------------------------------------
# Here's your Ruby and OpenSSL environment:
# 
# Ruby:           1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
# RubyGems:       1.8.23.2
# Bundler:        1.17.3
# Compiled with:  OpenSSL 1.0.2n  7 Dec 2017
# SSL_CERT_FILE:  /usr/lib/ssl/cert.pem
# SSL_CERT_DIR:   /usr/lib/ssl/certs
# 
# With that out of the way, let's see if you can connect to rubygems.org...
# 
# Bundler connection to rubygems.org:       success ✅
# RubyGems connection to rubygems.org:      success ✅
# Ruby net/http connection to rubygems.org: success ✅
# 
# Hooray! This Ruby can connect to rubygems.org. You are all set to use Bundler and RubyGems. 
Dharman
  • 30,962
  • 25
  • 85
  • 135
Paul D.
  • 156
  • 2
  • 12
  • 2
    Thank you so much. I uppdated to ruby 2.2.5 last week lol. – Sam Apr 19 '21 at 06:36
  • Nice! Are you running a legacy app which requires a lower version of Ruby? – Paul D. Apr 19 '21 at 10:52
  • I hope I didn't come across as one of the "screamers," as I understand how some institutions continue using EOL software, and only want to pointed out some of the risks (which become apparent in an attempt install using RVM). I would suggest also adding your explanation here to questions like [this](https://stackoverflow.com/questions/11078166/how-do-i-install-ruby-1-9-3-on-ubuntu-without-rvm) or even creating a new canonical self-answer question like "How can I install Ruby 1.9.3 even though it's EOL" – user513951 Apr 20 '21 at 16:13