From rubytree-users at rubyforge.org Tue Oct 26 10:20:21 2010 From: rubytree-users at rubyforge.org (Discussion list for rubytree library users) Date: Tue, 26 Oct 2010 16:20:21 +0200 Subject: [Rubytree-users] Initializing a Binary Tree Message-ID: Hello Everyone I'm trying to use the rubytree gem for a school project. I managed to get it working in general, but I can't initialize a binary tree. For Example, the following cod works well: require 'rubygems' require 'tree' root_node = Tree::TreeNode.new("ROOT", "Root Content") root_node.print_tree Now my question is, shouldn't the following code work for a binary tree, or am I wrong? require 'rubygems' require 'tree' root_node = Tree::BinaryTreeNode.new("ROOT", "Root Content") On this line, it returns the following: NameError: uninitialized constant Tree::BinaryTreeNode from (irb):6 I use the following setup, if thats any help: $ gem list --local *** LOCAL GEMS *** rubytree (0.8.1) $ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10] $ gem -v 1.3.4 The OS is Mac OS 10.6.4. I hope, someone can give me a hint. Johannes From rubytree-users at rubyforge.org Tue Oct 26 11:09:19 2010 From: rubytree-users at rubyforge.org (Discussion list for rubytree library users) Date: Tue, 26 Oct 2010 10:09:19 -0500 Subject: [Rubytree-users] Initializing a Binary Tree In-Reply-To: References: Message-ID: <68BB8A94-E516-4C69-AD66-5D9D582688D1@detailedbalance.net> Hi Johannes, On Oct 26, 2010, at 9:20 AM, Discussion list for rubytree library users wrote: > Hello Everyone > > I'm trying to use the rubytree gem for a school project. I managed to get it working in general, but I can't initialize a binary tree. > > For Example, the following cod works well: > > require 'rubygems' > require 'tree' > root_node = Tree::TreeNode.new("ROOT", "Root Content") > root_node.print_tree > > Now my question is, shouldn't the following code work for a binary tree, or am I wrong? > > require 'rubygems' > require 'tree' > root_node = Tree::BinaryTreeNode.new("ROOT", "Root Content") > > On this line, it returns the following: > > NameError: uninitialized constant Tree::BinaryTreeNode > from (irb):6 You also need `require 'tree/binarytree'` (checked on 0.7.0). Rhett > > > I use the following setup, if thats any help: > > $ gem list --local > *** LOCAL GEMS *** > > rubytree (0.8.1) > > > $ ruby -v > ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10] > > $ gem -v > 1.3.4 > > The OS is Mac OS 10.6.4. > > I hope, someone can give me a hint. > > Johannes > _______________________________________________ > Rubytree-users mailing list > Rubytree-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubytree-users From rubytree-users at rubyforge.org Tue Oct 26 15:24:37 2010 From: rubytree-users at rubyforge.org (Discussion list for rubytree library users) Date: Tue, 26 Oct 2010 21:24:37 +0200 Subject: [Rubytree-users] Initializing a Binary Tree In-Reply-To: <68BB8A94-E516-4C69-AD66-5D9D582688D1@detailedbalance.net> References: <68BB8A94-E516-4C69-AD66-5D9D582688D1@detailedbalance.net> Message-ID: <38C2EF8B-696A-419D-B584-162DEE19581B@gmail.com> Hi Rhett Am 26.10.2010 um 17:09 schrieb Discussion list for rubytree library users: >> On this line, it returns the following: >> >> NameError: uninitialized constant Tree::BinaryTreeNode >> from (irb):6 > > You also need `require 'tree/binarytree'` (checked on 0.7.0). > > Rhett Thank you very much, that works also in version 0.8.1 and solved the problem. Johannes