0

I am trying to install Blunder.

gem install Blunder

but I got this error

ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
      Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)

I tried fixing it from this url (Error installing Bundler) but noting solved.

more details:

I can accsess "https://rubygems.org/" url. (without using any proxy.)

I can download "https://rubygems.org/specs.4.8.gz"

I connected through some VPNs connections, but I got same error.

I tested update command . but I got this error

gem install rubygems-update

C:\Windows\System32>gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)

I tested some other gem installation commands such as

gem update --system
gem install installer


C:\Windows\System32>gem install installer
ERROR:  Could not find a valid gem 'installer' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)

C:\Windows\System32> gem install rubygems-update
ERROR:  Could not find a valid gem 'rubygems-update' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)

result of "gem sources -a http://rubygems.org" command.

C:\WINDOWS\system32>gem sources -a http://rubygems.org
https://rubygems.org is recommended for security over http://rubygems.org

Do you want to add this insecure source? [yn]  y
http://rubygems.org is too similar to https://rubygems.org

Do you want to add this source? [yn]  y
Error fetching http://rubygems.org:
        Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (http://rubygems.org/specs.4.8.gz)

result of "gem sources -r https://rubygems.org -a http://rubygems.org" command.

C:\WINDOWS\system32>gem sources -r https://rubygems.org -a http://rubygems.org
https://rubygems.org is recommended for security over http://rubygems.org

Do you want to add this insecure source? [yn]
https://rubygems.org is recommended for security over http://rubygems.org

Do you want to add this insecure source? [yn]  y
http://rubygems.org is too similar to https://rubygems.org

Do you want to add this source? [yn]  y
Error fetching http://rubygems.org:
        Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (http://rubygems.org/specs.4.8.gz)

I installed last version of Ruby 2.7.1-1-x64 after installation I ran the 'ridk install' to setup MSY2 ..... but I saw one error

gpg: refreshing 8 keys from hkps://hkps.pool.sks-keyservers.net
gpg: keyserver refresh failed: General error
==> ERROR: A specified local key could not be updated from a keyserver.

Also, in the 'C:\Ruby26-x64\lib\ruby\2.6.0\win32\registry.rb" file. I set Local encoding from

LOCALE = Encoding.find(Encoding.locale_charmap)

to

LOCALE = Encoding::UTF_8


Thanks for any help.

mostafa a
  • 151
  • 1
  • 6

1 Answers1

0

I set proxy in the "Configure Proxy Server" from internet explorer, to the 127.0.0.1:1080. Then I used a proxy application like Ultra-surfe and set its port to 1080. and finally "gem install bundler" command worked.

Now, my question is: Why Ruby tries to connecting to its server from proxy port??! I checked proxy from command line by this code

netsh winhttp show proxy

also I reset proxy

netsh winhttp show proxy

but Ruby "gem installation" 's command still looks for opening a TCP connection through 127.0.0.1:1080. Why??? Does something wrong with my system?

I sure this is n't a problem with my system as "npm install ..." command works fine. for example this command

npm install touch-cli -g

I am going to search about this problem, and maybe I will ask my new question in a new post, later.

mostafa a
  • 151
  • 1
  • 6