Gem repository not found when installing rails - ruby-on-rails

I have Ruby 1.8.7 and Ruby 1.9.2 installed on my Windows Machine.
In my console when I do ruby -v it gives me Ruby 1.8.7
Now when I try
gem install rails -v 2.3.8
I get this error
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: could not find gem rails locally or in a repository
My RubyGems version show 1.3.5 so I tried to update it
gem update --system
I get this error
Updating RubyGems
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::E10013: An attempt was made to access a socket in a way forbidden by
its access permissions. - connect(2) (http://gems.rubyforge.org/yaml)`
What is going wrong?

Give this a try.
gem sources
That will show you what sources you are using.
gem sources -a http://rubygems.org
gem sources -a http://gems.github.com
gem sources -a http://gems.rubyforge.org/
Those will add the most used gem sources.

I got the same error, but when I tried to set the company's proxy with SET HTTP_PROXY, I got a problem because the proxy uses NTLM validation and I needed to specify my AD-Domin which won't work wit gem. The way I got around it was installing fiddler and starting it and then setting
SET HTTP_PROXY=http://localhost:8888
afterwards my gems installed like a charm!

Related

Gem error to install

I try to install rails but I am faced to the following error.
Has somebody any idea how to resolve it ?
C:\Users\Utilisateur>gem -v
2.0.14
C:\Users\Utilisateur>gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (htt
ps://rubygems.org/latest_specs.4.8.gz)
C:\Users\Utilisateur>gem install rails --source http://rubygems.org
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (htt
ps://rubygems.org/latest_specs.4.8.gz)
Unable to download data from http://rubygems.org/ - no such name (http
://rubygems.org/latest_specs.4.8.gz)
First try to update ruby gems.
gem update --system
The issue most likely is with your internet connection.
If you see this issue again, try
gem install rails --source http://rubygems.org
You can add the not https source permanently like this
gem sources -a http://rubygems.org
Do you want to add this insecure source? [yn]y
I want to give you one more tip:
Don't develop rails on windows. Ruby and rails and many gems are very UNIXy in their ways. Install virtualbox and ubuntu on a virtual machine and run you development for there.
You might have proxy in your system. So use sudo http_proxy=http://host:port gem install rails.
I had the same issue but I ran the "Start command prompt with Ruby" as an administrator and tried the gem install rails and it worked.
I had to run 'gem install' as root to get this to work. I.e. 'sudo', which is less than ideal.
I suspect 'gem' has very poor error reporting and doesn't communicate the real cause from a permissions issue deep down the stack.
In my country for some strange reason rubygems.org domain is blocked. So a vpn was the solution for me.
My problem was I had configured a proxy in my network connection as #theBuzzyCoder said, so I simply changed my connection and it worked, I could install my gem (sass in my case)

ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format

I am trying to execute the command "gem update --system" in my windows command prompt and it shows the error as
Updating rubygems-update
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
When I try to install any gems also with gem install gemname command it is showing the same error message.
Please help. I am executing the command in windows.
I get the same issue with ruby version 1.9.3-p551 downloaded with rbenv on macOS High Sierra and looking for multiple solutions online but none of them work.
However, I notice that when I run
gem sources
The result is
*** CURRENT SOURCES ***
http://rubygems.org/
When I run with ruby version 2.1.9, the result is
*** CURRENT SOURCES ***
https://rubygems.org/
So I remove the http source and use https
gem sources -r http://rubygems.org/
gem sources -a https://rubygems.org/
It works! So I doubt that the http server has problem dealing with gzip encoding. Hope this help for everyone using old ruby version like 1.9.3.
For anybody who is reviving some old app:
I tried downloading GEM from rubygems.org and installing with gem install gemname.gem but it still ended with same err:
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
Adding explicitly --local helped.
gem install --local ~/Downloads/gemname-X.Y.gem
Not going to investigate more, but it was with:
RUBYGEMS VERSION: 1.3.5
RUBY VERSION: 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin18.7.0]
in ASDF environment..with custom compiled openssl 1.0.2
Are you trying to do this at your workplace or school that might be blocking the downloads?
The solution in this question: ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format
Was to download the gems directly from http://rubygems.org/gems, then run the install commands, since it looks locally first.

Installing rails is failing: Unable to download data

I'm trying to install rails on a new machine and am running to the following command issue:
gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from http://gems.rubyforge.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (http://gems.rubyforge.org/latest_specs.4.8.gz)
rubyforge.org was deprecated in favor of rubygems.org -- quite a while ago, this is nothing new. But you are stuck with an old source, i was too, just updated.
You probably want to do the following, first remove rubyforge.org as a source:
gem source -r http://gems.rubyforge.org
Next add rubygems.org as a source
gem source -a http://rubygems.org
Now do a gem update:
gem update --system
Check to see which version of gem you are running:
gem -v
Should be on 2.0.6 (or greater).
Good to go!
RubyForge was down today. :)
See here.
You could not reach the gems server. Could be many things but you can find the status of RubyForge here: http://status.rubygems.org/

updating the ruby gem 1.8.5

hiii
i am trying to update my gem file. Current version of gem is 1.8.5
When i am trying to update it using command " gem install rubygems-update -v 1.8.5 " it is giving following error
**
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: Name or service not known
(http://rubygems.org/gems/rubygems-update-1.8.5.gem)
**
I am working on ubuntu 10.04
also i tried to update using command " gem update --system "
it is giving the error as below
Updating rubygems-update
**
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find a valid gem 'rubygems-update' (1.8.6) locally or in
a repository
**
i also tried the solution given on the link http://lightyearsoftware.com/2009/07/updating-rubygems-to-recent-1-3-x/
please help me to resolve the problem..
If you are under Windows 7, run the command prompt as Administrator.
Read this thread. The error reported is the same of yours.
Try to apply the Google DNS configuration to your connection.
Otherwise you can try to install locally the gem, downloading it on rubygems.org. After this, in the directory you downloaded the gem, try to install it locally with the command: gem install gem_name --local
I also had this error. I resolved it with
gem uninstall rubygems-update
(you may need to be sudo) and then reinstalled with
gem install rubygems-update
now it's working fine, hope this is helpful
Try this:
Manually uninstall the gem you want to remove: gem uninstall [gemToUinistall]
Download the gem manually from http://rubygems.org/
try to install the gem from local : gem install [gemToInstall]

How do I install Ruby on Rails?

i have ruby 1.8.6 installed on my machine when i tried gem -v i got gem version 0.9.2
now i do install rails i tried gem install rails
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
getaddrinfo: no address associated with hostname.(SocketError)
why is it so and after installtion where rails is stored. and one thing net connection is required to install rails??
http://www.linux.com/archive/articles/154366
http://rubyonrails.org/download
Use;
http://bitnami.org/stack/rubystack

Resources