Forum: Ruby Another require question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9be86fcdf4b26d72af27519b921ab0ec?d=identicon&s=25 Ed Hardy (ebh)
on 2008-11-01 22:59
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.
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2008-11-01 23:11
(Received via mailing list)
Ed Hardy wrote:
> 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.
This topic is locked and can not be replied to.