Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update gems in Ruby for Windows?

Tags:

ruby

rubygems

I'm using Ruby's Command prompt. I cannot install any update, but internet navigation seems to be working.

I have no proxy here.

C:\Windows\System32>gem update activesupport
Updating installed gems
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SocketError: getaddrinfo: No such host is known.  (http://rubygems.org/latest_specs.4.8.gz)

What could be wrong?

Here is my environment:

C:\Ruby\bin>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.6.2
  - RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby/lib/ruby/gems/1.9.1
     - C:/Users/wmj/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
like image 800
Junior Mayhé Avatar asked Mar 15 '11 23:03

Junior Mayhé


People also ask

How do I update a specific version of a gem?

The correct way to update the version of a gem to a specific version is to specify the version you want in your Gemfile, then run bundle install . As for why your command line was failing, there is no -version option.

How do I update my gemlock file?

To automatically update the Gemfile. lock with your current version of Bundler, run bundle update --bundler . In general, it's a good idea to use the latest version of Bundler. That's why my Ruby on Mac script is meant to be run often to keep your system up to date with the latest versions of Bundler and Rubygems.


1 Answers

First run (with administrator privileges):

gem update --system

Then run the update for activesupport. I have that error one time, because i was behind a proxy, in that case, put:

gem update --http-proxy http://web.proxy.uri --system 
like image 88
Gareve Avatar answered Oct 24 '22 01:10

Gareve