Gem list --remote --details gives "ERROR: While executing gem ... (NoMethodError)"

Hi,

when trying

$ gem list --remote --details

I get

*** REMOTE GEMS ***

ERROR: While executing gem ... (NoMethodError)
    undefined method `empty?' for #<Syck::PrivateType:0x99f0804
@value="", @type_id="null">

$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

Installed via rvm.

Is there anything I can do to fix this?

gem list --remote works, but I'd like to see more information. The
default output doesn't describe what the package really does and often
the names are ambiguous.

thx,
- Markus

I probably should have added the version of gem ...

$ gem --version
1.6.2

Hi,

I figure the problem

"undefined method `empty?' for #<Syck::PrivateType:0x99f0804
@value="", @type_id="null">"

comes from rubygems/commands/query_command.rb line 222:

if spec.rubyforge_project and not spec.rubyforge_project.empty? then

I figured something must be mixed up here and spec.rubyforge_project
should not be a Syck::PrivateType .

When I change it to

if spec.rubyforge_project and
spec.rubyforge_project.respond_to?(:empty?) and not
spec.rubyforge_project.empty? then

the command "gem list --remote --details" does not abort but runs ...
after about seven minutes I get this:

$ time gem list --remote --details > gems-details
ERROR: While executing gem ... (NameError)
    uninitialized constant Syck::Syck

real 7m4.031s
user 0m21.269s
sys 0m7.144s

Maybe the command isn't supposed to work this way?

thx,
- Markus

I guess we should bring this conversation back around to the heart of the
matter: what is it that you want to accomplish by listing all 22,000+ gems
on your local machine?

I mean, there are search engines devoted specifically to listing out gems
for you (http://www.gemcutter.org, RubyDoc.info: Documenting RubyGems, Stdlib, and GitHub Projects) and giving you
some pertinent details about the gem itself (such as where to go for more
information). There are resources to help you find the best gem for the
task at hand (http://ruby-toolbox.com/\), and plenty of other places to find
out about gems.

-Nick Klauer

···

On Sun, Mar 27, 2011 at 06:16, Markus Fischer <markus@fischer.name> wrote:

Hi,

I figure the problem

"undefined method `empty?' for #<Syck::PrivateType:0x99f0804
@value="", @type_id="null">"

comes from rubygems/commands/query_command.rb line 222:

if spec.rubyforge_project and not spec.rubyforge_project.empty? then

I figured something must be mixed up here and spec.rubyforge_project
should not be a Syck::PrivateType .

When I change it to

if spec.rubyforge_project and
spec.rubyforge_project.respond_to?(:empty?) and not
spec.rubyforge_project.empty? then

the command "gem list --remote --details" does not abort but runs ...
after about seven minutes I get this:

$ time gem list --remote --details > gems-details
ERROR: While executing gem ... (NameError)
   uninitialized constant Syck::Syck

real 7m4.031s
user 0m21.269s
sys 0m7.144s

Maybe the command isn't supposed to work this way?

thx,
- Markus

Hi,

I guess we should bring this conversation back around to the heart of the
matter: what is it that you want to accomplish by listing all 22,000+ gems
on your local machine?

I mean, there are search engines devoted specifically to listing out gems
for you (http://www.gemcutter.org, RubyDoc.info: Documenting RubyGems, Stdlib, and GitHub Projects) and giving you
some pertinent details about the gem itself (such as where to go for more
information). There are resources to help you find the best gem for the
task at hand (http://ruby-toolbox.com/\), and plenty of other places to find
out about gems.

indeed .. I didn't realize this, seriously. Whenever I used a ruby
software before, which required a certain gem, not every software
clearly says "use this or that gem", I mostly used "gem list --remote| |
grep name" to figure the right one. I use this because the default
pattern you can pass to gem only checks for gems beginning with that
name ... There are other such inconveniences, like "gem help" telling me
I need "gem help commands" to see all of them. I'd expect "gem help" or
"gem --help" telling my that. I there weren't the examples, "gem help"
by itself would only be another help pointer .. not that helpful :confused:

Now I thought, before installing the gem and I located it already with
the above grep command, I wanted to have more details. So since I cannot
pass a pattern to gem which matches anywhere in it's name, only from the
beginning, I thought I just fetch all of it.

Didn't realize there where sooooo many. I didn't knew all the links you
posted (especially gemcuttter.org and ruby-toolbox), for me it was just
the "gem" tool available and I thought I'd use it more or less like I
use e.g. aptitude/dpkg/apt-cache search and friends (where I seldom
visited the Debian project web page). It seems it doesn't maintain a
local package cache dir from the remote site(s?).

As it stands now, it's just a matter for me to realize what "gem" and
it's objective is and what it isn't. Guess that has been cleared up for
some points :wink:

thanks,
- Markus

···

On 27.03.2011 13:50, Nick Klauer wrote:

Apologies for sounding snarky. I didn't intend to. Don't forget that gem
search is a way to search gem listings as well (and saves you typing the
pipe to grep)

gem search -r <gemName>

And if you want some more details besides just --details,

gem spec -r <gemName>

but I'd lean on those other sites (especially Ruby Toolbox, that site
rocks). There's also podcasts that try to round up the latest goings-on in
the Ruby community:

   - Ruby5 - http://ruby5.envylabs.com/
   - Ruby Show - http://rubyshow.com/

-Nick Klauer

···

On Sun, Mar 27, 2011 at 07:39, Markus Fischer <markus@fischer.name> wrote:

Hi,

On 27.03.2011 13:50, Nick Klauer wrote:
> I guess we should bring this conversation back around to the heart of the
> matter: what is it that you want to accomplish by listing all 22,000+
gems
> on your local machine?
>
> I mean, there are search engines devoted specifically to listing out gems
> for you (http://www.gemcutter.org, http://www.rubydoc.info/\) and giving
you
> some pertinent details about the gem itself (such as where to go for more
> information). There are resources to help you find the best gem for the
> task at hand (http://ruby-toolbox.com/\), and plenty of other places to
find
> out about gems.

indeed .. I didn't realize this, seriously. Whenever I used a ruby
software before, which required a certain gem, not every software
clearly says "use this or that gem", I mostly used "gem list --remote| |
grep name" to figure the right one. I use this because the default
pattern you can pass to gem only checks for gems beginning with that
name ... There are other such inconveniences, like "gem help" telling me
I need "gem help commands" to see all of them. I'd expect "gem help" or
"gem --help" telling my that. I there weren't the examples, "gem help"
by itself would only be another help pointer .. not that helpful :confused:

Now I thought, before installing the gem and I located it already with
the above grep command, I wanted to have more details. So since I cannot
pass a pattern to gem which matches anywhere in it's name, only from the
beginning, I thought I just fetch all of it.

Didn't realize there where sooooo many. I didn't knew all the links you
posted (especially gemcuttter.org and ruby-toolbox), for me it was just
the "gem" tool available and I thought I'd use it more or less like I
use e.g. aptitude/dpkg/apt-cache search and friends (where I seldom
visited the Debian project web page). It seems it doesn't maintain a
local package cache dir from the remote site(s?).

As it stands now, it's just a matter for me to realize what "gem" and
it's objective is and what it isn't. Guess that has been cleared up for
some points :wink:

thanks,
- Markus