Forum: Ruby Local gem not always visible

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.
billmcn (Guest)
on 2005-12-02 04:34
(Received via mailing list)
I wrote a gem for a package called "tree", version 0.0.0.  I built a
gemfile and installed it.  Now the code is installed and works, but
only some of the gem utitlities know that it's there.  I suspect I did
something wrong in my gem specification file, but I can't figure out
what.

Does anyone have any ideas what is wrong or suggestions on how to
debug?

Here are the specifics of the problem: "gem list" and "gemwhich" find
my gem

$ gem list

*** LOCAL GEMS ***

rake (0.6.2)
    Ruby based make-like utility.

rubygems-update (0.8.11)
    RubyGems Update GEM

sources (0.0.1)
    This package provides download sources for remote gem installation

tree (0.0.0)
    Tree is an ordered n-ary branching tree structure

$ gemwhich tree
/homes/billmcn/lib/ruby/gems/1.8/gems/tree-0.0.0/lib/tree.rb

but 'gem specification' and 'gem uninstall' do not work

$ gem specification tree
ERROR:  Unknown gem tree

$ gem uninstall tree
Attempting to uninstall gem 'tree'
ERROR:  While executing gem ... (RuntimeError)
    Unknown RubyGem: tree (> 0)

These commands work for other gems installed on my machine.

When I go look under /homes/billmcn/lib/ruby/gems/1.8 there appear to
be the appropriate cache, doc, gems, and specifications files and
subdirectories.  In particular, here is the specfile

$ cat tree-0.0.0.gemspec
Gem::Specification.new do |s|
  s.name = %q{tree}
  s.version = "0.0.0"
  s.date = %q{2005-12-01}
  s.summary = %q{Tree is an ordered n-ary branching tree structure}
  s.email = %q{removed_email_address@domain.invalid}
  s.homepage = %q{http://www.washington.edu/~billmcn}
  s.description = %q{This module implement order n-ary branching tree
structures.  It includes support for breadth- and depth- first
iteration, and serialization to and from a bracketed tree string.}
  s.has_rdoc = true
  s.authors = ["W.P. McNeill"]
  s.files = ["test/test_tree.rb", "lib/tree.rb", "README"]
  s.test_files = ["test/test_tree.rb"]
  s.rdoc_options = ["--title", "Tree -- Ruby Tree", "--main", "README",
"--line-numbers", "--inline-source"]
  s.extra_rdoc_files = ["README"]
end


This is RedHat Linux.  Ruby version

$ ruby -v
ruby 1.8.3 (2005-09-21) [i686-linux]

Note that I don't have write permissions to /usr so this version of
Ruby is installed in my home directory.

RUBYOPT=rubygems is set.  Here is my gems environment

$ gem env
Rubygems Environment:
  - VERSION: 0.8.11 (0.8.11)
  - INSTALLATION DIRECTORY: /homes/billmcn/lib/ruby/gems/1.8
  - GEM PATH:
     - /homes/billmcn/lib/ruby/gems/1.8
  - REMOTE SOURCES:
     - http://gems.rubyforge.org


Thanks for any suggestions you have.
chadfowler (Guest)
on 2005-12-02 17:48
(Received via mailing list)
On 12/1/05, billmcn <removed_email_address@domain.invalid> wrote:
> I wrote a gem for a package called "tree", version 0.0.0.  I built a
> gemfile and installed it.  Now the code is installed and works, but
> only some of the gem utitlities know that it's there.  I suspect I did
> something wrong in my gem specification file, but I can't figure out
> what.
>
> Does anyone have any ideas what is wrong or suggestions on how to
> debug?
>

Hi.  I bet this is due to a bug that was fixed in CVS wherein gem
files with version 0.0.0 are not properly accounted for in some cases.
 Would it be possible to get rubygems from its RubyForge CVS
repository and try it out?

Thanks!
--
Chad F.
http://chadfowler.com
http://pragmaticprogrammer.com/titles/mjwti/ (My Job Went to India,
and All I Got Was This Lousy Book)
http://rubycentral.org
http://rubygarden.org
http://rubygems.rubyforge.org (over one million gems served!)
billmcn (Guest)
on 2005-12-02 21:36
(Received via mailing list)
This appears to be the problem.  I didn't check out the latest rubygems
from CVS, but I did change the version on my tree gem from 0.0.0 to
0.0.1 and everything worked fine.

Thanks for your help.
This topic is locked and can not be replied to.