While I try install 'gem install watir' I get this error - ruby

While I try to install the watir, I have the following error, Can anyone please guide me how to resolve this problem?
C:\>gem install watir -v 4.0.2
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ECONNRESET: An existing connection was forcibly closed by the remote
host. - SSL_connect (https://api.rubygems.org/api/v1/dependencies?gems=watir-webdriver)
I am using Ruby 2.1.5 and WATIR 4.0.2.

Whenever you see the following error:
Errno::ECONNRESET: An existing connection was forcibly closed by the remote host.
But you can access internet normally, it has a high possibility that your request has been blocked by the Chinese governments' Great Firewall.
In such case, you can try changing your DNS settings to 8.8.8.8(Google) if you are not in China, or you can use Taobao's mirror otherwise.
See ruby.taobao.org for details, if you understand Chinese.
The worst case is that the IP of the server serving the gem is blocked by Great Firewall. It will intercept TCP handshakes by send RST packets to both your browser/client and the server. In such case, you have to use some proxy or VPN to get your job done.

You need to change your rails ssl certificate

Related

Failed to open TCP connection to 127.0.0.1:9515 rspec testing

I have an rspec/selenium/capybara suite that has been working flawlessly for months. Now suddenly I am getting a whole host of errors:
Failed to open TCP connection to 127.0.0.1:9515 (Only one usage of each socket address (protocol/network address/port) is normally permitted
I am testing an actual website, not a local instance so I don't know why 127.0.0.1 is showing up at all. I know there are a number of other questions similar to this on here, but I have yet to find one that addresses my issue.
Not sure what other information to include...
Port 9515 is the default port for chromedriver, so the connection attempt to 127.0.0.1:9515 is selenium attempting to connect to chromedriver in order to control the browser (Chrome) - The error would tend to indicate that chromedriver isn't starting up correctly. Check you have the latest version of chromedriver installed (or at least one that is compatible with the version of Chrome you're using') and also update selenium-webdriver. If using the chromedriver-helper gem you need to do bundle exec chromedriver -v when checking which version you're actually using since it installs a shim that can end up with you using a different version than it would appear if you just ran chromedriver -v

Error installing the svn2git gem (EADDRNOTAVAIL)

I'm trying to use svn2git on a test PC before using it with my real projects.
So I have tortoiseSVN installed and a project working with SVN in a local repository (I work on my test only in local network, the PC is not connected to other item).
I installed GIT for my tests (V 1.9.5-preview20150319), and Ruby in V2.2.2 to use gem.
I followed this link :http://www.troyhunt.com/2014/08/migrating-from-subversion-to-git-with.html
but when i type the command : "gem install svn2git", it does not work, I have the following error :
ERROR : while executing gem ... (Errno::EADDRNOTAVAIL)
The requested address is not valid in its context - connect(2) for "0.0.0.0" port 53
I downloaded svn2git-2.3.2 and placed it in Ruby22\lib\ruby\gems\2.2.0\gems\svn2git-2.3.2
If you have any suggestion..
Thanks
Was also struggling with that.
You need to install a loopback adapter on Windows. Search for it, there's lots of guides on DuckDuckGo on how to do that.

i cannot install haml using "gem install haml"

i have already downloaded ruby 2.2.1 and in command prompt i hv tried the command
gem install haml
but error is coming like:
ERROR: Could not find a valid gem 'haml' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUS ED: No connection could be made because the target
machine actively refused it.
- connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8 .gz)
It might be because of the firewall company have put up in every system. I have gone through trying different proxies picked up from different websites. Can anybody tell how to install or use haml/sass?
Company firewalls, the bane of many a developer's existence.
The best thing you can do:
Talk to the local networking team and get it unblocked for direct access.
If that fails:
Do they have a proxy you can use? gem will honor proxy variables, so if you get access to one, you can do an export https_proxy="http://someaddress:someport", and then your command should work.
If that also fails
Now we're left with circumventing the network policies - Be careful, as this could get you in trouble.
Options include:
Getting an external proxy that allows port 80 (it sounds like 80 works from your question). You could set up a squid instance on your home machine and access it that way via the variable method above.
Doing an SSH tunnel through a machine that does have unrestricted internet access, and using tsocks to tunnel through there.
There are others, but these two are relatively easy to set up.
I must emphasize here, be careful! Even if your networking group is impeding your ability to do your job, either get your boss's support, or be as stealthy as possible and discontinue use of these tools once you have what you need.
If it's a rails project, you can try to change the first line of your Gemfile from source 'https://rubygems.org' to source 'http://rubygems.org'.
If you are using a ruby project, try to download gem without https, like : gem install -s http://rubygems.org haml

Connection error when running memcached with dalli

I'm having trouble connecting to a Memcached server running on localhost from Dalli. I have been using Dalli with the Memcachier Heroku add-on for a while without any problems though I don't have any experience running Memcached locally.
I downloaded memcached with homebrew and it seems to have installed without a problem. I'm running it like this:
memcached -l 127.0.0.1 -p 11211 -vv
I can connect to the server and query it with
telnet 127.0.0.1 11211
The verbose output of memcached logs all the requests, so I know it's running fine. However, I'm unable to run it with Dalli. I am trying to connect like this:
require 'dalli'
dc = Dalli::Client.new('127.0.0.1:11211')
dc.set('foo', 123)
After I run the last command, Dalli unfailingly spits out
Dalli::RingError: No server available
from /Users/mac/.rvm/gems/ruby-1.9.3-p392/gems/dalli-2.6.4/lib/dalli/ring.rb:45:in `server_for_key'
from /Users/mac/.rvm/gems/ruby-1.9.3-p392/gems/dalli-2.6.4/lib/dalli/client.rb:347:in `perform'
from /Users/mac/.rvm/gems/ruby-1.9.3-p392/gems/dalli-2.6.4/lib/dalli/client.rb:199:in `set'
... so I'm getting this connection error, but I don't know why. Here's the weird part: Memcached is receiving the request, but it never succeeds in connecting. The following two lines are spit out by the verbose output whenever I try to connect:
<6 new client connection
<6 connection closed.
So what's going on here? Is this an authentication thing? Am I forgetting a command-line option?
EDIT: Figured out what was going on -- I was doing everything right except I was using the builtin version of Memcached. Installed the latest version and everything was fine.
Pretty simple issue, actually: I was just using an out-of-date Memcached version. No idea why that breaks Dalli, but installing a new Memcached fixed it.
That breaks dalli because dalli uses the newer binary memcached protocol instead of the older text-only protocol.
It does this for performance, but unfortunately makes dalli unusable with versions older than memcached 1.4

Problem in Ruby Gems Source Installation

I get the following error while performing the following commmand of adding rubygems.orgs as the gem source.
I am having Windows XP.
C:\>gem source --add http://rubygems.org
Error fetching http://rubygems.org:
SocketError: getaddrinfo: no address associated with hostname. (http://r
ubygems.org/specs.4.8.gz)
Please help me out and thanks in advance
It could be a DNS issue, as shown in this thread.
$ host rubygems.org rubygems.org has address 72.4.120.124
rubygems.org mail is handled by 10 izmunuti.segment7.net.
rubygems.org mail is handled by 20 ziz.jijo.segment7.net.
I get the same result, i can ping and lookup the URL just fine, I just can't add it to my gem source list :-(
I just accurately tried again, and now I successfully added rubygems as a source. May just have been a network problem.
If not, try a full ruby reinstall as suggested here and check out your remote sources.
If anyone gets this on a linux box the solution I found was to use one of Google's nameservers in my /etc/resolv.conf file.
nameserver 8.8.8.8

Resources