Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Ruby
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ruby section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 22nd, 2008, 10:12 AM
Registered User
Join Date: Jul 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Crippy
Default 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?

Old July 24th, 2008, 11:36 AM
Friend of Wrox
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts

(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
Old March 6th, 2013, 05:59 PM
Registered User
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
arrays ozPATT Excel VBA 2 November 4th, 2005 06:11 AM
Multidemmesional Arrays OR arrays gmoney060 Classic ASP Basics 3 November 1st, 2004 03:42 PM
Arrays tajin Excel VBA 0 June 20th, 2004 09:07 AM

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