1

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:\>
Moises Gonzaga
  • 151
  • 1
  • 17
  • 1
    Downgrade Ruby to 1.9 and it should solve your issues. This is a known issue with the rhc tool on Windows. – Mark B Jul 10 '15 at 20:44
  • @mbaird Thanks for your answer! I'm gonna do this. And I will be back for a feedback ! – Moises Gonzaga Jul 10 '15 at 21:15
  • @mbaird I tried, but was the same result. I changed to Ruby 1.9, and the problem it's the same. – Moises Gonzaga Jul 13 '15 at 17:05
  • 2
    Could you try `gem install rhc --source http://rubygems.org`, try doing `gem sources -c` then `gem sources -u`, also provide some information on how you connect to the internet (e.g. through a proxy, an odd dns setup, etc). – Azolo Jul 13 '15 at 20:18
  • @Azolo ... the result of those commands, they are already in the description. And I use a proxy to connect me to the Internet. – Moises Gonzaga Jul 14 '15 at 11:50
  • Ok, it's probably the proxy then. Give me a bit and I'll get the solution for how to connect through a proxy for you if you haven't figured it out by the time I get a chance. – Azolo Jul 14 '15 at 14:31

2 Answers2

1

It looks like rubygems.org was having problems around the time you posted this question.

However, it should be fixed now.

Azolo
  • 4,353
  • 1
  • 23
  • 31
1

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
Community
  • 1
  • 1
Azolo
  • 4,353
  • 1
  • 23
  • 31
  • and after this, I must be able to install the rhc rubygem right? ... if so, look this, maybe I'm missing something. `ERROR: While executing gem ... (URI::InvalidURIError) bad URI(is not URI?): http://damin\myuser:mypassword@ipProxy:portProxy` – Moises Gonzaga Jul 14 '15 at 21:11
  • You have to replace the the `myuser`, `mypassword`, `ipProxy`, `portProxy` with the corresponding information to connect to your proxy server. – Azolo Jul 15 '15 at 14:27
  • Yeap, I did it. I replaced it with the correct information, but that was the result, that kind of error. – Moises Gonzaga Jul 15 '15 at 16:10
  • 1
    err, sorry are you using *domain* authentication? If so can you try it without the *domain* prefixed? If not you will have to use `http://domain%5Cuser:password@proxy_ip:port` – Azolo Jul 15 '15 at 20:54
  • Awesome! Thank you so much for that advise, it works! Thanks for your help fixing this kind of issue. – Moises Gonzaga Jul 16 '15 at 11:39