From: Matt Harrison Date: 2008-12-30T08:10:44+09:00 Subject: Re: Newbie Problem 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 > > main.rb: > a_song = Song.new("Pie Jesu", "Sarah Brightman", "234") > song.inspect Have you require'd song.rb in you main.rb file? It should look something like: require 'song' a_song = Song.new("Pie Jesu", "Sarah Brightman", "234") song.inspect HTH Matt