NameError - Scruffy and Gruff -

Discussion in 'Ruby' started by Ams Lone, Aug 12, 2007.

  1. Ams Lone

    Ams Lone Guest

    I am trying to generate some charts using Scruffy or Gruff.. But both of
    them are failing with NameError.

    I am a noob and googled a lot. Any help on how to fix these errors.

    D:/Screener/Scruffy.rb:2: uninitialized constant Scruffy (NameError)


    /gruff.rb:4: uninitialized constant Gruff (NameError)
    from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    from D:/Screener/gruff.rb:2
    from -e:1:in `load'
    from -e:1
    --
    Posted via http://www.ruby-forum.com/.
     
    Ams Lone, Aug 12, 2007
    #1
    1. Advertising

  2. Ams Lone

    John Joyce Guest

    On Aug 12, 2007, at 12:51 AM, Ams Lone wrote:

    > I am trying to generate some charts using Scruffy or Gruff.. But
    > both of
    > them are failing with NameError.
    >
    > I am a noob and googled a lot. Any help on how to fix these errors.
    >
    > D:/Screener/Scruffy.rb:2: uninitialized constant Scruffy (NameError)
    >
    >
    > ./gruff.rb:4: uninitialized constant Gruff (NameError)
    > from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    > `gem_original_require'
    > from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    > `require'
    > from D:/Screener/gruff.rb:2
    > from -e:1:in `load'
    > from -e:1
    > --
    > Posted via http://www.ruby-forum.com/.
    >

    Posting code is better,
    but make sure you use

    require 'rubygems'
    require 'gemname'

    (where gemname is scruffy or whatever gem you are using)


    Also make sure you install a gem using
    gem install gemname --include-dependencies

    So you can make sure you are not missing anything.
     
    John Joyce, Aug 12, 2007
    #2
    1. Advertising

  3. Ams Lone

    Ams Lone Guest

    Hey John - I reinstalled scruffy using the include dependencies option,
    but still the same error..

    require 'rubygems'
    require 'scruffy'

    graph = Scruffy::Graph.new
    graph.title = "Comparative Agent Performance"
    graph.value_formatter = Scruffy::Formatters::percentage.new:)precision
    => 0)
    graph.add :stacked do |stacked|
    stacked.add :bar, 'Jack', [30, 60, 49, 29, 100, 120]
    stacked.add :bar, 'Jill', [120, 240, 0, 100, 140, 20]
    stacked.add :bar, 'Hill', [10, 10, 90, 20, 40, 10]
    end
    graph.point_markers = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']

    >ruby Scruffy.rb

    /scruffy.rb:4: uninitialized constant Scruffy (NameError)
    from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    from Scruffy.rb:2
    >Exit code: 1

    --
    Posted via http://www.ruby-forum.com/.
     
    Ams Lone, Aug 12, 2007
    #3
  4. Logan Capaldo wrote:
    > On 8/12/07, Ams Lone <> wrote:
    >> => 0)
    >> `gem_original_require'
    >> from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    >> `require'
    >> from Scruffy.rb:2
    >> >Exit code: 1

    >
    >
    > Don't name your script scruffy.rb. Ruby will always look in the current
    > directory first for files to require. You are requiring your own script
    > file
    > by accident. :)


    Actually it won't. "." is in $: the last entry.

    Regards
    Stefan
    --
    Posted via http://www.ruby-forum.com/.
     
    Stefan Rusterholz, Aug 12, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jorge Rodriguez

    Scruffy Stacked Bar help

    Jorge Rodriguez, Jun 7, 2007, in forum: Ruby
    Replies:
    0
    Views:
    95
    Jorge Rodriguez
    Jun 7, 2007
  2. scruffy question

    , Nov 5, 2007, in forum: Ruby
    Replies:
    3
    Views:
    126
    -- Got
    Dec 27, 2007
  3. Damaris Fuentes

    Scruffy and bars

    Damaris Fuentes, Feb 11, 2008, in forum: Ruby
    Replies:
    0
    Views:
    99
    Damaris Fuentes
    Feb 11, 2008
  4. Damaris Fuentes

    Scruffy: is it possible the use of 3 axis?

    Damaris Fuentes, Feb 25, 2008, in forum: Ruby
    Replies:
    0
    Views:
    93
    Damaris Fuentes
    Feb 25, 2008
  5. Jack Richardson

    Scruffy - how to assign SVG Builder object

    Jack Richardson, Mar 18, 2008, in forum: Ruby
    Replies:
    0
    Views:
    107
    Jack Richardson
    Mar 18, 2008
Loading...

Share This Page