p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Ruby (http://p2p.wrox.com/forumdisplay.php?f=198)
-   -   Help With Arrays (http://p2p.wrox.com/showthread.php?t=69542)

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?


ciderpunx July 24th, 2008 11:36 AM

(Don't have the book)

You're doing something like:

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 05: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 05:19 PM.

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