Forum: Ruby Rubygems Problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bryan R. (Guest)
on 2009-03-31 06:49
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?

--
Thanks!
Bryan
7stud -. (Guest)
on 2009-03-31 07:08
Bryan R. wrote:
> 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
Bryan R. (Guest)
on 2009-03-31 18:51
7stud -- wrote:
> 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.

--
Thanks!
Bryan
Dominic S. (Guest)
on 2009-03-31 18:58
(Received via mailing list)
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 S. <removed_email_address@domain.invalid>

> 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
Daniel B. (Guest)
on 2009-03-31 20:21
(Received via mailing list)
On Mar 31, 8:57 am, Dominic S. <removed_email_address@domain.invalid> wrote:
> 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 S. <removed_email_address@domain.invalid>
>
> > 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.

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=mofo version=0.2.16>
> #<Gem::Specification name=mojombo-grit version=1.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
Bryan R. (Guest)
on 2009-04-01 00:32
(Received via mailing list)
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...
Eric H. (Guest)
on 2009-04-01 00:54
(Received via mailing list)
On Mar 31, 2009, at 13:32, Bryan R. wrote:
>>>> error
>> I didn't have any problems.
>>>
>>> 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.
>
> 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.
Bryan R. (Guest)
on 2009-04-01 02:08
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.

--
Thanks!
Bryan
Jörg W Mittag (Guest)
on 2009-04-01 03:00
(Received via mailing list)
Bryan R. wrote:
> 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/4ac4acab7fd...

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/518385c5afb...

The last relevant change was this commit:

  <https://GitHub.Com/Mojombo/Grit/commit/ac8700fe977...

Which is probably the culprit.

jwm
This topic is locked and can not be replied to.