David Molnar David Molnar - 1 year ago 450
Ruby Question

Installing gem error (EADDRNOTAVAIL)

I am trying to install Redmine to a Windows Server 2012, following "How to MANUALLY install Redmine 3.x on Windows Server 2008 R2".

After installing http://rubyinstaller.org/downloads/ the next step is to install Bundler but I got the following error:

C:\inetpub\wwwroot\redmine>ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]

C:\inetpub\wwwroot\redmine>gem list

*** LOCAL GEMS ***

bigdecimal (1.2.6)
io-console (0.4.3)
json (1.8.1)
minitest (5.4.3)
power_assert (0.2.2)
psych (2.0.8)
rake (10.4.2)
rdoc (4.2.0)
test-unit (3.0.8)

C:\inetpub\wwwroot\redmine>gem install bundler
ERROR: While executing gem ... (Errno::EADDRNOTAVAIL)
The requested address is not valid in its context. - connect(2) for "
" port 53


Any help would be appreciated.

Answer Source

After poking around with ruby I noticed that uninstalling and reinstalling ruby does not remove some configs. I found a command:

gem env

This gave me the location of the configuration files. After completely deleting the directory .gem it started to work! Looks like something messed up my gem config and the defaults are right.

  1. Start Command prompt with Ruby
  2. Use command: gem env
  3. Check GEM PATHS and locate directory .gem
  4. Delete .gem directory
  5. Done

Good luck!