updating the ruby gem 1.8.5

2019-07-16 14:50发布

问题:

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..

回答1:

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



回答2:

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



回答3:

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]