From: Josh Cheek Date: 2010-12-01T00:43:34+09:00 Subject: Re: 'require' is not recognised --00163630fa19175a440496470de7 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Nov 30, 2010 at 8:38 AM, Jeremy Bopp wrote: > On 11/30/2010 8:36 AM, Tara Keane wrote: > > Sorry if I wasn't specific before > > I'm in irb and as soon as I type the first line of code i.e. require > > benchmark I get the error 'undefined local variable or method > > 'benchmark' for main:Object > > > > Then I tried saving all the code in a text file and running it from cmd > > prompt with Ruby test.rb and I got the same error. > > You need to put quotes around benchmark in your require statement. The > require method takes a string: > > require "benchmark" > > -Jeremy > > And "string" is just fancy programmer speak for "text" (data composed of sequential characters). And you define text by wrapping it in quotation marks, hence, as Jeremy said: require "benchmark" require is code -- it tells the interpreter to call the method named require (methods are just pieces of code that have been named, and can be executed over and over). "benchmark" is data -- the interpreter knows it is text (a string) and gives it to the require method. --00163630fa19175a440496470de7--