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.
112b68b29c51d07c738d8f58e38f4d2d?d=identicon&s=25 Bryan Richardson (btrichardson)
on 2009-03-31 04: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
54404bcac0f45bf1c8e8b827cd9bb709?d=identicon&s=25 7stud -- (7stud)
on 2009-03-31 05:08
Bryan Richardson 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
112b68b29c51d07c738d8f58e38f4d2d?d=identicon&s=25 Bryan Richardson (btrichardson)
on 2009-03-31 16: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
6ff7cc79a09836e7930763a9d8b6ba9a?d=identicon&s=25 Dominic Sisneros (Guest)
on 2009-03-31 16: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 Sisneros <dsisnero@gmail.com>

> 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
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (djberg96)
on 2009-03-31 18:21
(Received via mailing list)
On Mar 31, 8:57 am, Dominic Sisneros <dsisn...@gmail.com> 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 Sisneros <dsisn...@gmail.com>
>
> > 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
A3d6a80fa895857b3197d64d3cfd5154?d=identicon&s=25 Bryan Richardson (Guest)
on 2009-03-31 22: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...
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2009-03-31 22:54
(Received via mailing list)
On Mar 31, 2009, at 13:32, Bryan Richardson 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.
112b68b29c51d07c738d8f58e38f4d2d?d=identicon&s=25 Bryan Richardson (btrichardson)
on 2009-04-01 00: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
Ba91caa4b1fd66471e4180151b379dd7?d=identicon&s=25 Jörg W Mittag (Guest)
on 2009-04-01 01:00
(Received via mailing list)
Bryan Richardson 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.