p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Ruby (http://p2p.wrox.com/ruby-198/)
-   -   Help With Arrays (http://p2p.wrox.com/ruby/69542-help-arrays.html)

Crippy July 22nd, 2008 10:12 AM

Help With Arrays
 
Hi, I'm trying to get the example on page 22, chapter 1, "Beginning Ruby on Rails". The example is arrays.rb. When I run the program, I get a warning on the first line, "warning: already initialized constant Array. I also get an error on line five, arrays.rb5: undefined method "new" for Array <NoMethodError>. Any ideas? Is this telling me that the method new is not available in Instant Rails?

-Crippy

ciderpunx July 24th, 2008 11:36 AM

(Don't have the book)

You're doing something like:
Code:

a = Array.new
Should be fine

--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk

AK223 March 6th, 2013 04:59 PM

I had some confusion on this topic as well, but I was able to find this blog via @veriously which definitely helped me along. I hope it's useful to you in your work. http://blog.teamtreehouse.com/ruby-arrays [:)]


All times are GMT -4. The time now is 06:55 PM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.