[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

running ruby

yahdoco

9/4/2007 6:15:00 PM

Hi Everyone...I am a very new ruby user. I have downloaded ruby to my
computer (windows98). I have a ruby icon on my desktop with the name
hello. In the notepad part of the icon (hello.rb) are the following
words:

#generate some simple output (comment)
puts "Hello World"

When I click on the icon, a small screen appears with the name ruby.
The screen in visible for a few seconds. Then it disappears. The
screen is black and the words on it are white. I can't read the words
because the screen disappears too quickly.

How can I make the screen stay visible until I choose to click it off?
How can I change the screen so that the words are in black letters on
a white background?

Thanks for your help. Yahdoco

26 Answers

Lloyd Linklater

9/4/2007 6:24:00 PM

0

yahdoco wrote:
> How can I make the screen stay visible until I choose to click it off?
> How can I change the screen so that the words are in black letters on
> a white background?

Hiya!

What about adding a gets at the end?
--
Posted via http://www.ruby-....

Konrad Meyer

9/4/2007 6:48:00 PM

0

On Tuesday 04 September 2007 11:20:05 am yahdoco wrote:
> Hi Everyone...I am a very new ruby user. I have downloaded ruby to my
> computer (windows98). I have a ruby icon on my desktop with the name
> hello. In the notepad part of the icon (hello.rb) are the following
> words:
>
> #generate some simple output (comment)
> puts "Hello World"
>
> When I click on the icon, a small screen appears with the name ruby.
> The screen in visible for a few seconds. Then it disappears. The
> screen is black and the words on it are white. I can't read the words
> because the screen disappears too quickly.
>
> How can I make the screen stay visible until I choose to click it off?
> How can I change the screen so that the words are in black letters on
> a white background?
>
> Thanks for your help. Yahdoco

Go to the start menu > Run, and type "cmd" (sans quotation marks). This
should open a command prompt you can use to run it ("ruby hello.rb").

Hope it helps,

--
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertil...

yahdoco

9/4/2007 7:35:00 PM

0

On Sep 4, 2:24 pm, Lloyd Linklater <ll...@2live4.com> wrote:
>yahdoco wrote:
>> How can I make the screen stay visible until I choose to click it off?
>> How can I change the screen so that the words are in black letters on
>> a white background?
--------------------------
> Hiya!
> What about adding a gets at the end?
--------------------------
I changed the file hello.rb to the following:
#generate some simple output (comment)
puts "Hello World"
gets
--------------------------
The screen still disappears very quickly. In a slow computer moment I
did see the words "Hello World."
Any other ideas?

yahdoco

9/4/2007 8:12:00 PM

0

I sill have the same two problems:
(1)The hello world screen disappears quickly.
(2)The letters are white on a black background.
I tried using MyComputer>ControlPanel>Display and the
DialogBox(Appearance) but nothing changed.
Any other ideas out there?
Thanks. Yahdoco

Alex Young

9/4/2007 8:18:00 PM

0

yahdoco wrote:
> I sill have the same two problems:
> (1)The hello world screen disappears quickly.
What have you tried? Can you post some code?

> (2)The letters are white on a black background.

> I tried using MyComputer>ControlPanel>Display and the
> DialogBox(Appearance) but nothing changed.
> Any other ideas out there?
Right click on the title bar of the console window, and select
Properties. Set the colours up on the Colors tab. I don't know if it's
possible to control this from Ruby - I'd expect it would be, but I've
never needed to...

--
Alex

Konrad Meyer

9/4/2007 8:24:00 PM

0

On Tuesday 04 September 2007 01:15:04 pm yahdoco wrote:
> I sill have the same two problems:
> (1)The hello world screen disappears quickly.
> (2)The letters are white on a black background.
> I tried using MyComputer>ControlPanel>Display and the
> DialogBox(Appearance) but nothing changed.
> Any other ideas out there?
> Thanks. Yahdoco

Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
prompt that *doesn't* go away quickly, as I told you in the first email.

--
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertil...

Phillip Gawlowski

9/4/2007 8:51:00 PM

0



> -----Original Message-----
> From: yahdoco [mailto:yahdoco@yahoo.com]
> Sent: Tuesday, September 04, 2007 10:15 PM
> To: ruby-talk ML
> Subject: Re: running ruby
>
> I sill have the same two problems:
> (1)The hello world screen disappears quickly.

This is your Command Prompt. You can open it via Run -> "cmd" in the box, or
via your Programs in Accessories (IIRC, it is there. It should have an icon
reading MS-DOS). Then, you'll have a command prompt in black with grayish
text, eagerly awaiting to do your bidding. Tell it to go to your desktop, by
typing in "cd c:\documents and settings\<put your user name here>\Desktop".
That should get you where you have placed your hello.rb file.

Once you are at the place you saved your hello.rb, just type "ruby
hello.rb", and you'll see the output of your command prompt.

If you cannot find your hello.rb, just type "irb" at the command prompt, and
you enter the interactive Ruby shell. You can experiment with Ruby there,
too.

Please note: I'm not sure about the place of your Desktop, since it has been
ages since I've worked with Windows 98.

--
Phillip Gawlowski


Todd Benson

9/4/2007 8:59:00 PM

0

On 9/4/07, Konrad Meyer <konrad@tylerc.org> wrote:
> On Tuesday 04 September 2007 01:15:04 pm yahdoco wrote:
> > I sill have the same two problems:
> > (1)The hello world screen disappears quickly.
> > (2)The letters are white on a black background.
> > I tried using MyComputer>ControlPanel>Display and the
> > DialogBox(Appearance) but nothing changed.
> > Any other ideas out there?
> > Thanks. Yahdoco
>
> Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
> prompt that *doesn't* go away quickly, as I told you in the first email.

Actually, in W98, I believe the command is "command" not "cmd".

To the OP:

Most rubyists run their programs from the command line. But if you
truly want to double click on an icon to run a program, you'll need
two files.

If your hello.rb file is in c:\ruby, you will need to create a file on
your desktop (or wherever) containing this text: "ruby
c:\ruby\hello.rb %1", and then rename it to have a .cmd extension (not
tested, by the way, since I don't have W98).

hth,

Todd

yahdoco

9/4/2007 8:59:00 PM

0

> Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
> prompt that *doesn't* go away quickly, as I told you in the first email.
------------------------------
I click on start>run and I get a dialog box with the word OPEN:
I enter the word cmd and I get an error Dialog Box with the words:
Cannot find tye file 'cmd' (or one of it's components). Make sure the
path and filename are correct and that all required libraries are
available.
The hello.rb program does not run.
It only runs when I enter "hello.rb", but the response (an active
window with the name ruby) come up and then quickly disappears.
Any other ideas? Thanks. Yahdoco

Konrad Meyer

9/4/2007 10:36:00 PM

0

On Tuesday 04 September 2007 02:00:09 pm yahdoco wrote:
> > Don't just type "hello.rb" in the run box. Type "cmd", and you get a
command
> > prompt that *doesn't* go away quickly, as I told you in the first email.
> ------------------------------
> I click on start>run and I get a dialog box with the word OPEN:
> I enter the word cmd and I get an error Dialog Box with the words:
> Cannot find tye file 'cmd' (or one of it's components). Make sure the
> path and filename are correct and that all required libraries are
> available.
> The hello.rb program does not run.
> It only runs when I enter "hello.rb", but the response (an active
> window with the name ruby) come up and then quickly disappears.
> Any other ideas? Thanks. Yahdoco

As Todd pointed out, the program to run in W98 is "command", not "cmd" --
you should try that. You should also probably get a newer operating system,
sheesh.

--
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertil...