I'm trying to teach myself Ruby(and then rails) using Pragmatic's
"Programming Ruby" for the language part. I get the following error
under NetBeans:
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/core_ext/symbol.rb:1:in
`const_missing': uninitialized constant Song (NameError)
from C:\Projects\RubyLearning\RubyApplication1\lib\main.rb:4
when I try to run a two-file project built from the first example in
Chapter 3:
song.rb:
# Sample code from Programing Ruby, page 23
class Song
def initialize(name, artist, duration) @name = name @artist = artist @duration = duration
end
end
You have to require 'song.rb' in your main.rb file. Near the top of your
main.rb file place the following line (if they are both in the same
directory)
require 'song.rb'
Scott
···
On Mon, Dec 29, 2008 at 4:04 PM, <sehlat@berkeley.edu> wrote:
I'm trying to teach myself Ruby(and then rails) using Pragmatic's
"Programming Ruby" for the language part. I get the following error
under NetBeans:
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/core_ext/symbol.rb:1:in
`const_missing': uninitialized constant Song (NameError)
from C:\Projects\RubyLearning\RubyApplication1\lib\main.rb:4
when I try to run a two-file project built from the first example in
Chapter 3:
song.rb:
# Sample code from Programing Ruby, page 23
class Song
def initialize(name, artist, duration) @name = name @artist = artist @duration = duration
end
end
I'm trying to teach myself Ruby(and then rails) using Pragmatic's
"Programming Ruby" for the language part. I get the following error
under NetBeans:
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/core_ext/symbol.rb:1:in
`const_missing': uninitialized constant Song (NameError)
from C:\Projects\RubyLearning\RubyApplication1\lib\main.rb:4
when I try to run a two-file project built from the first example in
Chapter 3:
song.rb:
# Sample code from Programing Ruby, page 23
class Song
def initialize(name, artist, duration) @name = name @artist = artist @duration = duration
end
end
Thank you. The require statement doesn't get mentioned until about
fifty pages farther on.
···
On Mon, 29 Dec 2008 18:09:47 -0500, Scott Lillibridge <scott@thereisnoarizona.org> wrote:
[Note: parts of this message were removed to make it a legal post.]
You have to require 'song.rb' in your main.rb file. Near the top of your
main.rb file place the following line (if they are both in the same
directory)
require 'song.rb'
Scott
On Mon, Dec 29, 2008 at 4:04 PM, <sehlat@berkeley.edu> wrote:
I'm trying to teach myself Ruby(and then rails) using Pragmatic's
"Programming Ruby" for the language part. I get the following error
under NetBeans:
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/core_ext/symbol.rb:1:in
`const_missing': uninitialized constant Song (NameError)
from C:\Projects\RubyLearning\RubyApplication1\lib\main.rb:4
when I try to run a two-file project built from the first example in
Chapter 3:
song.rb:
# Sample code from Programing Ruby, page 23
class Song
def initialize(name, artist, duration) @name = name @artist = artist @duration = duration
end
end