Update_rubygems problem

I am using ubuntu 10.04. Downloaded ruby-1.9.2-p136 and installed it
successfully. Then I tried to update rubygems, but whatever I try it
does not work.

sudo update_rubygems

or

sudo gem update --system

or

cd /usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0
sudo ruby setup.rb

error occours like this:

sudo gem update --system

Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.4.0
Updating RubyGems to 1.4.0
Installing RubyGems 1.4.0
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems/source_index.rb:62:in
`installed_spec_directories': undefined method `path' for Gem:Module
(NoMethodError)
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems/source_index.rb:52:in
`from_installed_gems'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems.rb:914:in
`source_index'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems/gem_path_searcher.rb:98:in
`init_gemspecs'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems/gem_path_searcher.rb:13:in
`initialize'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems.rb:873:in
`new'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems.rb:873:in
`searcher'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems.rb:495:in
`find_files'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems.rb:1034:in
`load_plugins'
  from
/usr/local/ruby/gems/1.9.1/gems/rubygems-update-1.4.0/lib/rubygems/gem_runner.rb:84:in
`<top (required)>'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from setup.rb:25:in `<main>'

By the way;

gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [i686-linux]
  - INSTALLATION DIRECTORY: /usr/local/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/ruby/gems/1.9.1/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/local/ruby/gems/1.9.1
     - /home/mustafakyr/.gem/ruby/1.9.1
     - /usr/local/lib/ruby/gems/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org/&quot;, "http://gemcutter.org"]
     - "gemhome" => "/usr/local/ruby/gems/1.9.1"
  - REMOTE SOURCES:
     - http://rubygems.org/
     - http://gemcutter.org

I also tried to set GEM_HOME and GEM_PATH hopelessly via export command,
but it is not working.

Thanks in advance.

···

--
Posted via http://www.ruby-forum.com/\.

You should read the RubyGems 1.4 announcement in full.

···

On Sat, Jan 1, 2011 at 1:15 AM, Mustafa M. <mustafakyr@gmail.com> wrote:

I am using ubuntu 10.04. Downloaded ruby-1.9.2-p136 and installed it
successfully. Then I tried to update rubygems, but whatever I try it
does not work.

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

RubyGems 1.4.0 doesn't work on Ruby 1.9.x, yet.

http://rubygems.rubyforge.org/rubygems-update/UPGRADING_rdoc.html

···

--
Posted via http://www.ruby-forum.com/.

SOLVED ! Thanks a lot.
This is pretty interesting. I made a huge preconception and never
thought that newest rubygems has been made for old version of ruby. This
is pretty unusual.

···

--
Posted via http://www.ruby-forum.com/.

Jakub Arnold wrote:

RubyGems 1.4.0 doesn't work on Ruby 1.9.x, yet.

Shouldn't it have

    required_ruby_version = '< 1.9'

set in rubygems-update.gemspec, then?

Or have I fundamentally misunderstood what that's for? (Quite likely.)

jwm

Something like that.

The problem is not RubyGems, but Ruby's own "gem-prelude"
functionality.

The version of RubyGems that is bundled with Ruby is not meant to be
updated by the normal mechanism. Until that is sorted *in Ruby*, we
can't do anything.

We could have limited the gem update version matching, but then it
will raise questions like "I'm using Ruby 1.9.x and I'm not getting
RubyGems 1.4.0 when doing gem update --system"

So, the issue will be similar: inability to update RubyGems, either by
the gem requirement or by Ruby's own issues.

···

On Dec 31 2010, 11:42 pm, Jörg W Mittag <JoergWMittag +R...@GoogleMail.Com> wrote:

Jakub Arnold wrote:
> RubyGems 1.4.0 doesn't work on Ruby 1.9.x, yet.

Shouldn't it have

required\_ruby\_version = &#39;&lt; 1\.9&#39;

set in rubygems-update.gemspec, then?

Or have I fundamentally misunderstood what that's for? (Quite likely.)

--
Luis Lavena

Luis Lavena wrote:

Jakub Arnold wrote:

RubyGems 1.4.0 doesn't work on Ruby 1.9.x, yet.

Shouldn't it have

required\_ruby\_version = &#39;&lt; 1\.9&#39;

set in rubygems-update.gemspec, then?

Or have I fundamentally misunderstood what that's for? (Quite likely.)

Something like that.

The problem is not RubyGems, but Ruby's own "gem-prelude"
functionality.

The version of RubyGems that is bundled with Ruby is not meant to be
updated by the normal mechanism.

The documentation says otherwise:

    # gem help update
    Usage: gem update GEMNAME [GEMNAME ...] [options]

      Options:
            --system Update the RubyGems system software

If the 'gem update --system' functionality isn't meant to be used,
then why is it even there, and documented? Shouldn't it be removed? At
least, that's what the RubyGems maintainers told the Debian
maintainers, IIRC.

Until that is sorted *in Ruby*, we can't do anything.

I thought the whole point of putting stuff *into* Ruby was to *avoid*
version conflicts like this? I remember the developers of RubyOPAL
warning that putting RubyGems into Ruby would make it impossible to
develop better package management systems; I bet they never thought
that one of those better package management systems would be RubyGems
*itself* (-:

I guess the best part of this situation is that it will hopefully shut
up the "cram everything into Ruby" proponents and strengthen the
arguments of the proponents of *unbundling*.

We could have limited the gem update version matching, but then it
will raise questions like "I'm using Ruby 1.9.x and I'm not getting
RubyGems 1.4.0 when doing gem update --system"

So, the issue will be similar: inability to update RubyGems, either by
the gem requirement or by Ruby's own issues.

But the *message* won't.

With the version restriction in the gemspec, you would get something
like

    # gem update --system
    Updating RubyGems
    Updating rubygems-update
    ERROR: Error installing rubygems-update:
            rubygems-update requires Ruby version < 1.9.

Whereas right now, you actually get this:

    # gem update --system
    <internal:lib/rubygems/custom_require>:29: warning: loading in progress, circular require considered harmful - C:/Ruby/lib/ruby/1.9.1/rubygems.rb
            from C:/Ruby/bin/gem:8:in `<main>'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:1136:in `<top (required)>'
            from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:968:in `load_plugins'
            from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:968:in `each'
            from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:976:in `block in load_plugins'
            from C:/Ruby/lib/ruby/1.9.1/rubygems.rb:976:in `load'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/yard-0.6.4/lib/rubygems_plugin.rb:2:in `<top (required)>'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from C:/Ruby/lib/ruby/1.9.1/rubygems/doc_manager.rb:8:in `<top (required)>'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from <internal:lib/rubygems/custom_require>:29:in `require'
    Updating RubyGems
    Updating rubygems-update
    Temporarily enhancing PATH to include DevKit...
    Successfully installed rubygems-update-1.4.1
    Updating RubyGems to 1.4.1
    Installing RubyGems 1.4.1
    C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/source_index.rb:62:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/source_index.rb:52:in `from_installed_gems'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:914:in `source_index'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/gem_path_searcher.rb:98:in `init_gemspecs'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/gem_path_searcher.rb:13:in `initialize'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:873:in `new'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:873:in `searcher'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:495:in `find_files'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems.rb:1034:in `load_plugins'
            from C:/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.4.1/lib/rubygems/gem_runner.rb:84:in `<top (required)>'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from <internal:lib/rubygems/custom_require>:29:in `require'
            from setup.rb:25:in `<main>'
    RubyGems system software updated

You actually get a *success* message. You also get a NoMethodError
exception, of course, but that exception is accompanied by a warning,
which looks *exactly like* an exception, and which you learned to
automatically mentally filter out, since you *always* get tons of
warnings from Ruby (circular require), from RubyGems (something about
instance variable @prerelease not initialized and Win32API being
deprecated) and literally tens of thousands of warnings from YARD (two
warnings about two different uninitialized instance variables and an
overlapping range in a character class in a Regexp for every pass of
every visitor over every AST node of every file of every Gem).

jwm

···

On Dec 31 2010, 11:42 pm, Jörg W Mittag <JoergWMittag > +R...@GoogleMail.Com> wrote: