1

I am trying to install jekyll. But I am getting this error:

$ gem install jekyll bundler
ERROR:  Could not find a valid gem 'jekyll' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Gem::Net::OpenTimeout: Failed to open TCP connection to rubygems.org:443 (execution expired) (https://rubygems.org/specs.4.8.gz)
ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Gem::Net::OpenTimeout: Failed to open TCP connection to rubygems.org:443 (execution expired) (https://rubygems.org/specs.4.8.gz)

It should be noted that I have tried multiple times, my internet connection seems ok and the server is also not down. Why is it occurring? How can I fix this issue?

Moreover, I have tested with another gem too, facing the same error:

$ gem install rake
ERROR:  Could not find a valid gem 'rake' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Gem::Net::OpenTimeout: Failed to open TCP connection to rubygems.org:443 (execution expired) (https://rubygems.org/specs.4.8.gz)
ERROR:  Possible alternatives: DotCoverRakeTask, airake, airbrake, airbrake-api, airbrake-extended, airbrake-faraday_sender, airbrake-jets, airbrake-local, airbrake-resque, airbrake-ruby

Here are the installed prerequisites (https://jekyllrb.com/docs/installation/ubuntu/):

$ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]

$ gem -v 3.5.14

$ gem update --system ERROR: Your RubyGems was installed trough APT, and upgrading it through RubyGems itself is unsupported. If you really need the latest version of RubyGems (tip: you usually don't), then you need to install RubyGems (and Ruby) manually, maybe using tools like ruby-install, rvm, etc.

$ gem env RubyGems Environment:

  • RUBYGEMS VERSION: 3.5.14
  • RUBY VERSION: 3.0.2 (2021-07-07 patchlevel 107) [x86_64-linux-gnu]
  • INSTALLATION DIRECTORY: /var/lib/gems/3.0.0
  • USER INSTALLATION DIRECTORY: /home/rafi/.local/share/gem/ruby/3.0.0
  • RUBY EXECUTABLE: /usr/bin/ruby3.0
  • GIT EXECUTABLE: /usr/bin/git
  • EXECUTABLE DIRECTORY: /usr/local/bin
  • SPEC CACHE DIRECTORY: /home/rafi/.cache/gem/specs
  • SYSTEM CONFIGURATION DIRECTORY: /etc
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-linux-gnu
  • GEM PATHS:
    • /var/lib/gems/3.0.0
    • /home/rafi/.local/share/gem/ruby/3.0.0
    • /usr/local/lib/ruby/gems/3.0.0
    • /usr/lib/ruby/gems/3.0.0
    • /usr/lib/x86_64-linux-gnu/ruby/gems/3.0.0
    • /usr/share/rubygems-integration/3.0.0
    • /usr/share/rubygems-integration/all
    • /usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => true
    • :bulk_threshold => 1000
  • REMOTE SOURCES:
    • https://rubygems.org/
  • SHELL PATH:
    • /home/rafi/.local/bin
    • /home/rafi/bin
    • /usr/local/sbin
    • /usr/local/bin
    • /usr/sbin
    • /usr/bin
    • /sbin
    • /bin
    • /usr/games
    • /usr/local/games
    • /snap/bin
    • /snap/bin
    • /home/rafi/.rvm/bin

$ dpkg -l | grep ruby
ii  libruby3.0:amd64                              3.0.2-7ubuntu2.7                                     amd64        Libraries necessary to run Ruby 3.0
ii  rake                                          13.0.6-2                                             all          ruby make-like utility
ii  ruby                                          1:3.0~exp1                                           amd64        Interpreter of object-oriented scripting language Ruby (default version)
ii  ruby-dev:amd64                                1:3.0~exp1                                           amd64        Header files for compiling extension modules for Ruby (default version)
ii  ruby-full                                     1:3.0~exp1                                           all          Ruby full installation (default version)
ii  ruby-net-telnet                               0.1.1-2                                              all          telnet client library
ii  ruby-rubygems                                 3.3.5-2                                              all          Package management framework for Ruby
ii  ruby-webrick                                  1.7.0-3                                              all          HTTP server toolkit in Ruby
ii  ruby-xmlrpc                                   0.3.2-1ubuntu0.1                                     all          XMLRPC library for Ruby
ii  ruby3.0                                       3.0.2-7ubuntu2.7                                     amd64        Interpreter of object-oriented scripting language Ruby
ii  ruby3.0-dev:amd64                             3.0.2-7ubuntu2.7                                     amd64        Header files for compiling extension modules for the Ruby 3.0
ii  ruby3.0-doc                                   3.0.2-7ubuntu2.7                                     all          Documentation for Ruby 3.0
ii  rubygems-integration                          1.18                                                 all          integration of Debian Ruby packages with Rubygems

Update

It was set warp-cli connect for the package cloudflare-warp. After switching it to warp-cli disconnect, the errors don't appear for the command:

 sudo gem install jekyll bundler

Why was it happening with warp-cli connect? How can I use gem install keeping warp-cli connect? Do I need set a specific configuration for warp-cli?

And without sudo, it says this:

$ gem install jekyll bundler
Defaulting to user installation because default installation directory (/var/lib/gems/3.0.0) is not writable.
Successfully installed jekyll-4.3.3
Parsing documentation for jekyll-4.3.3
Done installing documentation for jekyll after 0 seconds
Defaulting to user installation because default installation directory (/var/lib/gems/3.0.0) is not writable.
Successfully installed bundler-2.5.14
Parsing documentation for bundler-2.5.14
Done installing documentation for bundler after 0 seconds
2 gems installed

Another error that is still appearing:

$ sudo gem update --system
ERROR:  Your RubyGems was installed trough APT, and upgrading it through RubyGems
itself is unsupported. If you really need the latest version of RubyGems (tip:
you usually don't), then you need to install RubyGems (and Ruby) manually,
maybe using tools like ruby-install, rvm, etc.

How can I fix it?

raf
  • 579

0 Answers0