Require error

Hi, I'm getting the following error.......

internal:lib/rubygems/custom_require>:28:in `require': wrong number of
arguments (2 for 1) (ArgumentError)

it corresponds to this line in my code....

require 'animals', 'csv'

Any idea what's going on?

···

--
Posted via http://www.ruby-forum.com/.

Paul Roche wrote:

Hi, I'm getting the following error.......

internal:lib/rubygems/custom_require>:28:in `require': wrong number of
arguments (2 for 1) (ArgumentError)

it corresponds to this line in my code....

require 'animals', 'csv'

Any idea what's going on?
  
Require only takes a single argument. If you want to load multiple files, you need to use multiple calls to "require"

-Justin

You didn't read the error message.

You handed a method 2 arguments where 1 was expected, so the method
complains about it.

···

On Fri, Oct 8, 2010 at 7:59 PM, Paul Roche <prpaulroche@gmail.com> wrote:

Hi, I'm getting the following error.......

internal:lib/rubygems/custom_require>:28:in `require': wrong number of
arguments (2 for 1) (ArgumentError)

it corresponds to this line in my code....

require 'animals', 'csv'

Any idea what's going on?

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

Hello,

internal:lib/rubygems/custom_require>:28:in `require': wrong number of
arguments (2 for 1) (ArgumentError)

it corresponds to this line in my code....

require 'animals', 'csv'

Any idea what's going on?

The error message seems pretty clear: 'require' is waiting for only
one argument ('animals' for example) and you give him two ('animals'
and 'csv'). Try two different requirements:

require 'animals'
require 'csv'

Cheers,

···

--
JJ Fleck
PCSI1 Lycée Kléber

Require takes 1 param.

irb(main):011:0> require 'rubygems'; require 'active_support'
=> true

irb(main):013:0> require 'rubygems', 'active_support'
ArgumentError: wrong number of arguments (2 for 1)
    from /opt/ruby-enterprise-1.8.6-20090113/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /opt/ruby-enterprise-1.8.6-20090113/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /opt/ruby-enterprise-1.8.6-20090113/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /opt/ruby-enterprise-1.8.6-20090113/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from (irb):13
irb(main):014:0>

···

from :0

On 10/8/10 12:59 PM, "Paul Roche" <prpaulroche@gmail.com> wrote:

Hi, I'm getting the following error.......

internal:lib/rubygems/custom_require>:28:in `require': wrong number of
arguments (2 for 1) (ArgumentError)

it corresponds to this line in my code....

require 'animals', 'csv'

Any idea what's going on?
--
Posted via http://www.ruby-forum.com/.

Thanks all for your replies. I failed to understand the error message.
Thanks for making it clearer to me

···

--
Posted via http://www.ruby-forum.com/.