From: "Savard, Joseph" Date: 2010-09-04T03:47:07+09:00 Subject: Re: uninitialized constant NArray (Name Error) Again, I think Brian explained this and quite accurately. I named my file gonary.rb contents require "rubygems" require "narray" ary1 = NArray.sfloat(3,4) puts ary1.inspect ---------------------------- Results ---------------------------- [09-03 07:03] 0 503:3 (0.16 Mb) ? ~/dev/noodle ! ruby gonary.rb NArray.sfloat(3,4): [ [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] See?? Cheers mate, j ________________________________ From: Abder-Rahman Ali Reply-To: Date: Thu, 2 Sep 2010 10:54:30 -0500 To: ruby-talk ML Subject: Re: uninitialized constant NArray (Name Error) @Savard. This works if working through irb. If I put the script in a .rb file "narray.rb", I get the following: C:\Users\Abder-Rahman\Desktop\Research>ruby narray.rb ./narray.rb:2: uninitialized constant NArray (NameError) from narray.rb:1:in `require' from narray.rb:1 Why is that? Why cannot I get it running as throigh irb? Of I insert require "rubygems", I get the following: C:\Users\Abder-Rahman\Desktop\Research>ruby narray.rb ./narray.rb:3: uninitialized constant NArray (NameError) from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from narray.rb:2 -- Posted via http://www.ruby-forum.com/.