Rubygems: gem install failing using jruby - Received fatal alert: protocol_version

Created on 22 Jun 2018  路  5Comments  路  Source: rubygems/rubygems

I'm having a problem installing any gem.

Here is the output of running gem install warbler:

gem install warbler -v 1.4.4
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR: Could not find a valid gem 'warbler' (= 1.4.4), here is why:
Unable to download data from https://rubygems.org/ - Received fatal alert: protocol_version (https://api.rubygems.org/specs.4.8.gz)

Here are my current environment details:

$ gem env version
2.7.7

$ gem env
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
RubyGems Environment:

  • RUBYGEMS VERSION: 2.7.7
  • RUBY VERSION: 1.9.3 (2014-10-28 patchlevel 392) [java]
  • INSTALLATION DIRECTORY: /Users/jhandfor/.rvm/gems/jruby-1.7.16.1
  • USER INSTALLATION DIRECTORY: /Users/jhandfor/.gem/jruby/1.9
  • RUBY EXECUTABLE: /Users/jhandfor/.rvm/rubies/jruby-1.7.16.1/bin/jruby
  • EXECUTABLE DIRECTORY: /Users/jhandfor/.rvm/gems/jruby-1.7.16.1/bin
  • SPEC CACHE DIRECTORY: /Users/jhandfor/.gem/specs
  • SYSTEM CONFIGURATION DIRECTORY: /Users/jhandfor/.rvm/rubies/jruby-1.7.16.1/etc
  • RUBYGEMS PLATFORMS:

    • ruby

    • universal-java-1.8

  • GEM PATHS:

    • /Users/jhandfor/.rvm/gems/jruby-1.7.16.1

    • /Users/jhandfor/.rvm/gems/jruby-1.7.16.1@global

  • GEM CONFIGURATION:

    • :update_sources => true

    • :verbose => true

    • :backtrace => false

    • :bulk_threshold => 1000

    • "install" => "--no-rdoc --no-ri --env-shebang"

    • "update" => "--no-rdoc --no-ri --env-shebang"

    • :ssl_verify_mode => 0

  • REMOTE SOURCES:
  • SHELL PATH:

    • /Users/jhandfor/.rvm/gems/jruby-1.7.16.1/bin

    • /Users/jhandfor/.rvm/gems/jruby-1.7.16.1@global/bin

    • /Users/jhandfor/.rvm/rubies/jruby-1.7.16.1/bin

    • /Users/jhandfor/.rvm/bin

    • /usr/local/apache-maven-3.5.3/bin

    • /usr/local/bin

    • /usr/bin

    • /bin

    • /usr/sbin

    • /sbin

$ bundle env

fatal: Not a git repository (or any of the parent directories): .git

Environment

Bundler       1.16.1
  Platforms   ruby, x86_64-darwin-17
Ruby          2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
  Full Path   /usr/local/opt/ruby/bin/ruby
  Config Dir  /usr/local/Cellar/ruby/2.5.1/etc
RubyGems      2.7.6
  Gem Home    /Users/jhandfor/.rvm/gems/jruby-1.7.16.1
  Gem Path    /Users/jhandfor/.rvm/gems/jruby-1.7.16.1:/Users/jhandfor/.rvm/gems/jruby-1.7.16.1@global
  User Path   /Users/jhandfor/.gem/ruby/2.5.0
  Bin Dir     /Users/jhandfor/.rvm/gems/jruby-1.7.16.1/bin
Tools         
  Git         2.15.2 (Apple Git-101.1)
  RVM         1.29.3 (latest)
  rbenv       not installed
  chruby      not installed
Gem.ruby      /usr/local/opt/ruby/bin/ruby
bundle #!     /usr/local/Cellar/ruby/2.5.1/bin/ruby

Bundler Build Metadata

Built At          2018-06-22
Git SHA           
Released Version  false

$ Output from running "ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'" script:
NameError: uninitialized constant OpenSSL::OPENSSL_LIBRARY_VERSION
const_missing at org/jruby/RubyModule.java:2723
(root) at -e:1

$ rvm version
rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

```

OS: Mac OS High Sierra 10.13.5

I will abide by the code of conduct.

Most helpful comment

https://rubygems.org/ must have stopped supporting TLSv1 recently as my setup with JRuby 1.7.16 broke too. A newer v1.7.27 works fine. See https://github.com/jruby/jruby/issues/1737

All 5 comments

https://rubygems.org/ must have stopped supporting TLSv1 recently as my setup with JRuby 1.7.16 broke too. A newer v1.7.27 works fine. See https://github.com/jruby/jruby/issues/1737

Correct, rubygems.org no longer serves traffic over TLSv1

Whats the solution for this. Its a key part of ELK stack:

Unable to download data from https://rubygems.org/ - Received fatal alert: protocol_version (https://api.rubygems.org/latest_specs.4.8.gz)

./plugin install logstash-input-http_poller
Validating logstash-input-http_poller
Unable to download data from https://rubygems.org/ - Received fatal alert: protocol_version (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Installation aborted, verification failed for logstash-input-http_poller

./plugin install logstash-input-http_poller
Validating logstash-input-http_poller
Unable to download data from https://rubygems.org/ - Received fatal alert: protocol_version (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Installation aborted, verification failed for logstash-input-http_poller

It was the TLS protcol. When I installed jruby 1.7.27 - my issue was resolved. Hope that helps.

Was this page helpful?
0 / 5 - 0 ratings