[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby on mac - requires don't work

Max Williams

2/15/2008 3:22:00 PM

Hi - i'm trying to write a ruby program on my wife's mac (i use linux
normally). In irb i can require a gem fine, but when i write a little
program, save it on her desktop and run it, the require doesn't work -
it can't find it.

I'm sure it's just some dumb thing i've not done or taken into account.
Do ruby scripts need to live somewhere in particular, for example?
--
Posted via http://www.ruby-....

3 Answers

Jari Williamsson

2/15/2008 4:03:00 PM

0

Max Williams wrote:
> Hi - i'm trying to write a ruby program on my wife's mac (i use linux
> normally). In irb i can require a gem fine, but when i write a little
> program, save it on her desktop and run it, the require doesn't work -
> it can't find it.
>
> I'm sure it's just some dumb thing i've not done or taken into account.
> Do ruby scripts need to live somewhere in particular, for example?

You probably are missing this line first:
require 'rubygems'


Best regards,

Jari Williamsson

Max Williams

2/15/2008 4:06:00 PM

0

Jari Williamsson wrote:
> Max Williams wrote:
>> Hi - i'm trying to write a ruby program on my wife's mac (i use linux
>> normally). In irb i can require a gem fine, but when i write a little
>> program, save it on her desktop and run it, the require doesn't work -
>> it can't find it.
>>
>> I'm sure it's just some dumb thing i've not done or taken into account.
>> Do ruby scripts need to live somewhere in particular, for example?
>
> You probably are missing this line first:
> require 'rubygems'
>
>
> Best regards,
>
> Jari Williamsson

doh! of course :)
thanks!
--
Posted via http://www.ruby-....

Gary Wright

2/15/2008 4:09:00 PM

0


On Feb 15, 2008, at 10:21 AM, Max Williams wrote:

> Hi - i'm trying to write a ruby program on my wife's mac (i use linux
> normally). In irb i can require a gem fine, but when i write a little
> program, save it on her desktop and run it, the require doesn't work -
> it can't find it.

If it is a gem that has gone missing try adding:

require 'rubygems'

before you attempt to require the gem. I'm assuming the gem is
installed in the gem repository and isn't just sitting in a file in a
working directory somewhere.

Gary Wright