Rubygems Problems

B

Bryan Richardson

Hello all,

Is anyone else having problems with Rubygems? I'm running Ubuntu 8.10
with Ruby version 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]. I have
Rubygems 1.3.1 installed from source, and when I run gem -v I get the
expected '1.3.1' printout. However, if I try to run a Ruby app that
calls for "require 'rubygems'" then "require '<some gem>'", I get the
following, no matter what gem I ask for:

/usr/local/lib/site_ruby/1.8/rubygems/gem_path_searcher.rb:96:in
`lib_dirs_for': undefined method `join' for nil:NilClass (NoMethodError)
from /usr/local/lib/site_ruby/1.8/rubygems/gem_path_searcher.rb:26:in
`initialize'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_path_searcher.rb:25:in
`each'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_path_searcher.rb:25:in
`initialize'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:684:in `new'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:684:in `searcher'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:683:in `synchronize'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:683:in `searcher'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:34:in
`require'
from system.rb:2

If I try it without the "require 'rubygems'", I get a 'no such file to
load -- <some gem> (LoadError)', so I know "require 'rubygems'" is
*somewhat* working...

Anyone else having this same issue?
 
7

7stud --

Bryan said:
Hello all,

Is anyone else having problems with Rubygems?

Yes. The forum is full of posts about ruby gems problems this week. I
suggest you post the output of:

$ gem env
 
B

Bryan Richardson

7stud said:
Yes. The forum is full of posts about ruby gems problems this week. I
suggest you post the output of:

$ gem env

Thanks 7stud, here's what you asked for:

foo@bar:~$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.1
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
- INSTALLATION DIRECTORY: /home/foo/.gems
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /home/foo/.gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/foo/.gems
- /var/lib/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gempath" => ["/home/foo/.gems", "/var/lib/gems/1.8"]
- :sources => ["http://gems.rubyforge.org/",
"http://gems.github.com"]
- "gemhome" => "/home/foo/.gems"
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com

I'll continue searching the forums to see how other people have fixed
their problems.
 
D

Dominic Sisneros

[Note: parts of this message were removed to make it a legal post.]

the update to mojombo-grit is the problem. Here is Aslax Hellesoy response
to my inquiry on the rubygems mailing list

2009/3/31 Dominic Sisneros said:
I did a gem cleanup and since then I have been getting the following error
whenever I try to use a gem

I had the same problem yesterday, when I upgraded all my gems. It turns out,
this error occurs if you have one broken gem.
My solution: Add a puts statement inside gem_path_searcher.rb to find out
what gem is broken. Then uninstall it. (For me it was the latest
mojombo-grit).


And here is the result of the puts

#<Gem::Specification name=mofo version=0.2.16>
#<Gem::Specification name=mojombo-grit version=1.1.0>
load error: C:/Documents and Settings/dominic e sisneros/.irbrc
NoMethodError: undefined method `join' for nil:NilClass
 
D

Daniel Berger

the update to mojombo-grit is the problem. =A0Here is Aslax Hellesoy resp= onse
to my inquiry on the rubygems mailing list



I had the same problem yesterday, when I upgraded all my gems. It turns o= ut,
this error occurs if you have one broken gem.

I've tried to duplicate this but I can't. I installed grit 1.0.0, then
grit 1.1.0, then ran "gem clean", then fired up irb and loaded a gem.
I didn't have any problems.

I'm curious in what way the gem is broken. The require_paths appears
to just be set to 'lib', which is fine.
My solution: Add a puts statement inside gem_path_searcher.rb to find out
what gem is broken. Then uninstall it. (For me it was the latest
mojombo-grit).

And here is the result of the puts

#<Gem::Specification name=3Dmofo version=3D0.2.16>
#<Gem::Specification name=3Dmojombo-grit version=3D1.1.0>
load error: C:/Documents and Settings/dominic e sisneros/.irbrc

This is interesting, and might be a clue as to the real problem. Could
spaces in the path name be an issue? I'm not sure. What does
your .irbc file look like? Also, do you have any non-ascii characters
in the path to the .irbc file?
NoMethodError: undefined method `join' for nil:NilClass

Looks like spec.require_paths is returning nil, which is very odd.
Like I said, I can't duplicate this, and I'm not sure how that could
happen.

Regards,

Dan
 
B

Bryan Richardson

I am getting the exact same NoMethodError having to do with calling
'join' on a nil class. I'm on a linux machine with no spaces in path
names. I haven't had a chance to try printing stuff out in Rubygems
yet...
 
E

Eric Hodel

I am getting the exact same NoMethodError having to do with calling
'join' on a nil class. I'm on a linux machine with no spaces in path
names. I haven't had a chance to try printing stuff out in Rubygems
yet...

If you figure out which gem is doing it, please send the gemspec from
the specifications/ dir and a tarball of the gem from the gems/ dir.
 
B

Bryan Richardson

Looks like it was mojombo-grit version 1.1.0. I uninstalled
mojombo-grit, then tested and rubygems worked fine. I then re-installed
it, and it installed version 1.1.1 (must have been released today since
I first installed mojombo-grit yesterday and I got 1.1.0). Works just
fine now too, so version 1.1.1 must have fixed it.
 
J

Jörg W Mittag

Bryan said:
Looks like it was mojombo-grit version 1.1.0. I uninstalled
mojombo-grit, then tested and rubygems worked fine. I then re-installed
it, and it installed version 1.1.1 (must have been released today since
I first installed mojombo-grit yesterday and I got 1.1.0). Works just
fine now too, so version 1.1.1 must have fixed it.

The only difference between the 1.1.0 and 1.1.1 Gems is this commit,
which apparently fixes the issue:

<https://GitHub.Com/Mojombo/Grit/commit/4ac4acab7fd9c7fd4c0e0f4ff5794b0347baecde>

Now, I ain't no RubyGems expert, but if there's anything in the Grit
Gem that could break RubyGems, my money would be on that 90000
characters s.files attribute.

However, the test files have already been added to the Gem in version
1.0.0 in January, in this commit, which, apparently, worked fine:

<https://GitHub.Com/Mojombo/Grit/commit/518385c5afba53957332119dd9fdf4980a779d6f>

The last relevant change was this commit:

<https://GitHub.Com/Mojombo/Grit/commit/ac8700fe97702bc13806a5bfea7a0e28f97b5f6b>

Which is probably the culprit.

jwm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,039
Messages
2,570,376
Members
47,027
Latest member
PilarRitch

Latest Threads

Top