if i understand your problem right you expected the script to produce
the same output as irb when run with ruby. if you want to see the
result of statements just print them out with p, print or puts.
hth,
-- henon
but actually i have tried with the puts...
i suppose i am not giving a command to invoke the program. let me
explain:
i have installed the irb.. somewhere in c:programfiles....
run irb from start menu
in text editor i type out a program *.rb
now where do i need to save OR
how do i give a proper path to run the *.rb file
but actually i have tried with the puts...
i suppose i am not giving a command to invoke the program. let me
explain:
i have installed the irb.. somewhere in c:programfiles....
run irb from start menu
in text editor i type out a program *.rb
now where do i need to save OR
how do i give a proper path to run the *.rb file
thanks in advance
san
Pass in a -r to either irb or ruby to load that module:
ruby -r yourmodule.rb
or
irb -r yourmodule.rb
Using the ruby command will load it non-interactively, so it'll run just
like a normal script.
Could you give us a little more information on this, like your system
info and a listing of the code you're trying to run?
It sounds like you have irb running, so ruby is there somewhere. Try:
ruby -v
just see which version of ruby you have and that it will respond at
all. Then type your program in Notepad ( I'm guessing your on Windows
) or some other editor and save it in a file myprogram.rb. Then you
should be able to:
ruby /path/to/myprogram.rb
And let us know what the result is, error or whatever...
Jeff
···
On 4/10/06, san <s_sasmal@yahoo.com> wrote:
thanks henon
but actually i have tried with the puts...
i suppose i am not giving a command to invoke the program. let me
explain:
i have installed the irb.. somewhere in c:programfiles....
run irb from start menu
in text editor i type out a program *.rb
now where do i need to save OR
how do i give a proper path to run the *.rb file
i have tried all the methods above but in vain
line by line commands are being executed but i could not run the program
as a whole
i have a screenshot of the commands. if you can plese look into it and
give your comments where i am going wrong. the first lines are same as
that in the file count.rb
i have tried all the methods above but in vain
line by line commands are being executed but i could not run the program as a whole
i have a screenshot of the commands. if you can plese look into it and give your comments where i am going wrong. the first lines are same as that in the file count.rb
you must exit from irb before you can run the command irb -v, similarly with the other commands that refuse to work. irb is the interactive version of ruby, it's not meant for running scripts. to run a script, open a new cmd prompt window and type in something like