# Ruby 1.9 and rubygems: should be able to use gem command?

**URL:** <https://www.ruby-forum.com/t/ruby-1-9-and-rubygems-should-be-able-to-use-gem-command/126694>\
**Category:** Ruby\
**Created:** [January 21, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/ruby-1-9-and-rubygems-should-be-able-to-use-gem-command/126694 "2008-01-21T13:18:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [January 21, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/ruby-1-9-and-rubygems-should-be-able-to-use-gem-command/126694/1 "2008-01-21T13:18:56Z")

</div>

Hi all,  
I’ve installed ruby 1.9 from trunk and I used the --prefix option to  
avoid conflicts with 1.8, like Dave T. advices here:  
[http://pragdave.blogs.pragprog.com/pragdave/2007/12/ruby-19right-fo.html](http://pragdave.blogs.pragprog.com/pragdave/2007/12/ruby-19right-fo.html)

Everything seem to work splendidly, except for the “gem” command. The  
new install has an empty gems cache of course, so all operations that  
need to access that will try to bulk download the indexes from  
[http://gems.rubyforge.org](http://gems.rubyforge.org)

All index downloading fails with a unhelpful “Error fetching remote gem  
cache: undefined method `[]=’ for nil:NilClass”

I started to try to find out where the failure occurs and it seems like  
the guilty file is open-uri.rb (line 411), which is a call to the  
meta\_add\_field of the Meta module (adding http heders I guess) where the  
@meta inst var (a hash) is added to. The inst var isn’t set, so that’s  
the nil in the above error message. Why is @meta nil? I’d say it’s  
because the Meta module isn’t initialized properly, but I dont know why.

Before digging any deeper I wanted to ask you all: am I the only one  
having issues with the “gem” command? Should it work? Any workarounds?  
Am I missing something very basic?

Oh, versions:  
gem -v =\> 1.0.1  
ruby -v =\> ruby 1.9.0 (2008-01-21 revision 0) [i686-linux]

Platforms: MacOS X 10.5 and Ubuntu Feisty Fawn

Thanks for any pointers/comments!

---

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [January 21, 2008, 6:51pm UTC](https://www.ruby-forum.com/t/ruby-1-9-and-rubygems-should-be-able-to-use-gem-command/126694/2 "2008-01-21T18:51:06Z")

</div>

I have the same behaviour, but only in trunk version. I suggest file  
the bug on rubyforge  
([http://rubyforge.org/tracker/?atid=1698&group\_id=426&func=browse](http://rubyforge.org/tracker/?atid=1698&group_id=426&func=browse) ,  
first check if somone already did it) and use version tagged as  
v1\_9\_0\_0 (revision 14711). It should work.

–  
Rados³aw Bu³at

[http://radarek.jogger.pl](http://radarek.jogger.pl) - mój blog

---

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [January 21, 2008, 8:33pm UTC](https://www.ruby-forum.com/t/ruby-1-9-and-rubygems-should-be-able-to-use-gem-command/126694/3 "2008-01-21T20:33:43Z")

</div>

David P. wrote:

> Oh, versions:  
> gem -v =\> 1.0.1  
> ruby -v =\> ruby 1.9.0 (2008-01-21 revision 0) [i686-linux]
> 
> Platforms: MacOS X 10.5 and Ubuntu Feisty Fawn
> 
> Thanks for any pointers/comments!

It seems to be working for me–I just installed the revactor gem for  
1.9. My setup may be a little different. I configured with  
–program-suffix=19 so that ruby 1.9 can live in /usr/local without  
conflict.

$ gem19 -v  
1.0.1  
$ ruby19 -v  
ruby 1.9.0 (2007-12-25 revision 14709) [i686-linux]  
$ uname -a  
Linux tumbleweed 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57 UTC 2007  
i686 GNU/Linux

(That’s Gutsy Gibbon)
