Another require question

E

Ed Hardy

I've been learning Ruby for 2 weeks and of course I like it.

However,

1)
'file.open(path)' returns this error in the SciTE editor:

"undefined local variable or method `math' for main:Object (NameError)"

2)
I try to require 'file' and fail at that too, even with an absolute path
to 'file.rb' under the gems folder.

Maybe I need to reinstall Ruby?

Help please.
 
T

Tim Hunter

Ed said:
I've been learning Ruby for 2 weeks and of course I like it.

However,

1)
'file.open(path)' returns this error in the SciTE editor:

"undefined local variable or method `math' for main:Object (NameError)"

2)
I try to require 'file' and fail at that too, even with an absolute path
to 'file.rb' under the gems folder.

Maybe I need to reinstall Ruby?

Help please.

I can't offer any advice on (1), but it sure looks like a typo to me.
For (2), do you need to require 'rubygems' first? I thought the OCI
normally set up the RUBYOPTS environment variable to "rubygems" but
perhaps I'm wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top