I'm trying to install Jekyll on my Windows 10 computer. I have installed Ruby+Devkit successfully and their versions are:
$ ruby -v
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x64-mingw-ucrt]
$ gem -v
3.3.3
$ bundle -v
Bundler version 2.3.3
But when I ran any of these commands:
$ gem install jekyll
or
$ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
or
$ bundle config mirror.https://rubygems.org https://gems.ruby-china.com
$ cd my-jekyll-repo
$ bundle install
or
ridk install
I was prompted with errors all including the message
Net::OpenTimeout: Failed to open TCP connection to localhost:1080 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - user specified timeout) (https://gems.ruby-china.com/specs.4.8.gz)
While I have installed Jekyll on other Windows 10 computers successfuly before I've never seen this error. I've searched in many places but couldn't find a solution. I don't understand why it's trying to connect to localhost:1080 but I tried to open the port from the firewall inbound rules as per this instruction and it doesn't work.
Related
So recently I was encountering some SSL cert issues so in order to help fix that, I've upgraded our jruby 1.7.4 to jruby 9.1.15 and our RubyMine to 2018.2.1 (team using Ruby Cucumber).
However, now we're facing an issue installing /updating gems and bundler after the upgrade.
We're trying to install from the command prompt:
$ set HTTP_PROXY=https://username:password#proxyurl.net:port
$ gem install bundler
And receiving the error:
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
Received fatal alert: protocol_version
Before setting the proxy the error was:
WARNING: Unable to pull data from 'https://rubygems.org/':
SocketError: Failed to open TCP connection to rubygems.org:443
(initialize: name or service not known)
(https://rubygems.org/specs.4.8.gz)
1 gem installed
I've even tried going to a Starbucks to avoid the proxy altogether but am still getting a similar error.
Just to add in trying to install bundler in RubyMine itself doesn't work.
So somehow I fixed it.. I'm not able to reproduce the fix but that might be related to some foundation problems the fix caused.
Basic steps I used (any of these might help):
Removed versions from gemfile
Trying to install bundler from outside proxy
Install bundler through command prompt and install gems through RubyMine
Change gemfile source to 'http' instead of 'https'
Will update more if I find how to reproduce fix
I'm trying to install vagrant-hostmanager plugin on Windows 7 without internet connection.
I have downloaded gem file from rubygems.org and copied to this machine to D:\distr\Vagrant.
Then I move to this folder and run in Command Prompt with Ruby (with Administrator privilegies):
vagrant plugin install vagrant-hostmanager --entry-point vagrant-hostmanager-1.8.6.gem
And get the following error:
Installing the 'vagrant-hostmanager' plugin. This can take a few minutes...
Vagrant failed to load a configured plugin source. This can be caused
by a variety of issues including: transient connectivity issues, proxy
filtering rejecting access to a configured plugin source, or a configured
plugin source not responding correctly. Please review the error message
below to help resolve the issue:
Errno::ECONNREFUSED: No connection could be made because the target machine ac
tively refused it. - connect(2) for "api.rubygems.org" port 443 (https://api.rub
ygems.org/specs.4.8.gz)
Source: https://rubygems.org/
I put specs.4.8.gz to his folder too but it didn't help. I also put specs.4.8 to SPEC CACHE DIRECTORY and gem file to GEM PATHS defined in gem environment. It also didn't help.
Versions:
Windows Enterprise Service Pack 1 (32 bit)
vagrant_1.9.5.msi
VirtualBox-5.1.22-115126-Win.exe
rubygems 2.5.2
rubyinstaller 2.3.3 (2016-11-21 patchlevel 222) [i386-mingw32]
I also tried with another versions of vagrant and gem: vagrant_1.8.4.msi and vagrant-hostmanager-1.8.5.gem. Result is the same.
Is it possible to install vagrant plugin offline?
Thanks!
I just installed ruby version 2.3.0p0 using the ruby installer for windows and was trying to install bundler. When I run gem install bundler I get the following error:
Could not find a valid gem 'bundler' (>=0), here is why
Unable to download data from (link removed) rubygems -Errno:ETIMEDOUT:
Failed to open TCP connection to api.rubygems.org:443 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. -connect(2) for "api.rubygems.org" port 443)(https://api.rubygems.org/specs.4.8.gz)
Some research led me to try running gem install --http-proxy http://[user]:[password]#[server]:[port] which i think might work because I am behind a proxy here and a similiar solution helped me clone a git repository earlier.
But when i tried this command I got the following error:
ERROR: While executing gem ... (Gem:CommandLineError)
Please Specify at least one gem name (e.g. gem build GEMNAME)
UPDATE
So I tried that gem install --http-proxy.... command again with the gem name at the end and I am back to getting the original TCP connection error above. I am pretty sure the login information I entered is correct. I also added --source http://... instead of the https one but still am having the same problem?
1st off your error is pretty telling-
ERROR: While executing gem ... (Gem:CommandLineError) Please Specify
at least one gem name (e.g. gem build GEMNAME)
2nd make sure you have met the requirements for what you're trying to do http://bundler.io/
then run the code..
gem install bundler
bundle init
echo 'gem "rspec"' >> Gemfile
bundle install
bundle exec rspec
In 2023, the best way to install bundler on an old version of Ruby is:
gem update --system
RubyGems and Bundler now ship together, so to get the latest bundler, you should just install the latest RubyGems.
would you try disable ipv6, it had been worked for me
I'm trying to install and configure 'OpenShift' on Windows. I installed the necessary tools like: Git, RubyGem 2.x, but when I try to install 'rhc' ruby gem I got this error:
C:\>ruby -v
ruby 2.1.6p336 (2015-04-13 revision 50298) [x64-mingw32]
C:\>gem install rhc
ERROR: Could not find a valid gem 'rhc' (>= 0) in any repositor
C:\>
I've been searching this issue through the Internet, but it was unsuccessfully...
When I run the following command: $gem sources, I got this.
C:\>gem sources
*** CURRENT SOURCES ***
C:\>
It seems like something is wrong here, but yes, I did what you think. I "added" the source but...
C:\>gem source -a http://rubygems.org
[https://rubygems.org][1] is recommended for security over http://rubygems.org
Do you want to add this insecure source? [yn] y
Error fetching [http://rubygems.org][1]:
no such name (http://rubygems.org/specs.4.8.gz)
C:\>
What should I do guys? I've been reading so many forums and other webpages, but none of them gave me a solution to that.
Additional information: Windows 7 (x64), Ruby 2.1.6 (actually I had installed Ruby 2.2, but I found in some forums that this issue can fixed just back to and old version of Ruby). I use a proxy to connect me to Internet.
Updating info.
C:\>gem install rhc --source http://rubygems.org
ERROR: Could not find a valid gem 'rhc' (>= 0), here is why:
Unable to download data from http://rubygems.org/ - no such name (http://rubygems.org/specs.4.8.gz)
C:\>gem sources -c
*** Removed specs cache ***
C:\>gem sources -u
source cache successfully updated
C:\>gem install rhc --source http://rubygems.org
ERROR: Could not find a valid gem 'rhc' (>= 0), here is why:
Unable to download data from http://rubygems.org/ - no such name (http://rubygems.org/specs.4.8.gz)
C:\>
So the important information that you shared in your comments (you're behind a proxy) means that you will have to set some environment variables in order to use rubygems through the proxy.
In cmd.exe use:
set http_proxy=http://user:password#proxy_ip:port
or in PowerShell:
$env:http_proxy=http://user:password#proxy_ip:port
There was a case where that format didn't work and a different format had to be used:
http_proxy = proxy_ip:port
http_proxy_user = user
http_proxy_pass = password
Domain Users:
Try without the Domain prefix first, unless you know that the default Domain isn't set or that your Domain isn't the default.
Using a Domain User Login and the domain\user format, the \ must be replaced using its percent-encoding equivalent counterpart: %5C.
http://domain%5Cuser:password#proxy_ip:port
It looks like rubygems.org was having problems around the time you posted this question.
However, it should be fixed now.
I need to install win32-api and antlr3 on a computer without internet connection. Had it such a connection, I'd use gem like so:
gem install win32-api -r
gem install antlr3 -r
This won't obviously work. So, I thought there should be a way to download the gem and install it later, but I am not sure how I would proceed.
I found gem's which operator, which seemd to indicate the local location of a gem:
c:\>gem which antlr3
c:/tools/Ruby187/lib/ruby/gems/1.8/gems/antlr3-1.8.8/lib/antlr3.rb
however, it didn't work on win32-api:
c:\>gem which win32-api
ERROR: Can't find ruby library file or shared library win32-api
although I have previously installed it.
Can someone hint at the right direction to go on from here?
Try,
gem install --local path/to/file.gem
I had some problems with this on a VM. The VM intentionally did not have Internet access (sneaker-net test machine) but it still had some DNS servers configured.
For example:
$ gem install bundler-1.7.7.gem --local
ERROR: While executing gem ... (Errno::ENETUNREACH)
Network is unreachable - sendto(2) for "192.168.1.10" port 53
192.168.1.10 is the DNS server that VirtualBox configured. So what I had to do is comment out /etc/resolv.conf with ; at the beginning of all the lines. Even leaving in Google DNS would break it.
; /etc/resolv.conf
nameserver 8.8.8.8 ; nope. gem install --local doesn't like it
; You will get a Network is unreachable - sendto(2) for "8.8.8.8" port 53
If you comment out all of /etc/resolv.conf then you can install gems locally (from a file) it seems.
$ gem install bundler-1.7.7.gem --local
Successfully installed bundler-1.7.7
Parsing documentation for bundler-1.7.7
Installing ri documentation for bundler-1.7.7
Done installing documentation for bundler after 4 seconds
WARNING: Unable to pull data from 'https://rubygems.org/': no such name (https://rubygems.org/specs.4.8.gz)
1 gem installed
Ruby gems version: 2.4.4 on Ruby 2.1.5.
gem will first look in the current directory after .gem files. Try downloading the .gem files of the gems you want to install on a computer with an internet connection (and don't forget dependencies), then move the files over to the other computer and run gem install xyz in the same directory where you placed the .gem files.