From: Phani Medicharla Date: 2010-07-25T13:02:02+09:00 Subject: Re: basic beginner help needed Hello Karl, Try going through these books to get started in Ruby - http://www.humblelittlerubybook.com/book/hlrb.pdf http://www.sapphiresteel.com/The-Book-Of-Ruby I have quoted these as they are readily available on the internet for free. And as pointed out by Heruacles, posting the code snippet with which you have a problem will help the forum give you better answers. After you write code in notepad (try notepad++ or any other code editor which will give you syntax highlighting, this will help you learn easily) save the file with a .rb extension anywhere on your computer (have a separate folder for this to keep your ruby files in one place). Setting the PATH environment variable to the ruby->bin folder helps you launch the ruby interpreter from the command line (from any path). If you have installed ruby in your C drive for e.g., the bin dir would be c:\ruby-1.9.1\bin Add this path to the PATH environment variable. After this, you can open command prompt, navigate to the path where you saved your ruby file and type 'ruby filename'. For e.g, if you have saved your file in a folder called 'my scripts' on D with the name 'first.rb', you must type the following in the command prompt D:\my scripts>ruby first.rb Karl Halvorson wrote: > I am new to Ruby and have been looking for some basic beginner help. I > have not been able to find a beginner forum anywhere, so I apologize if > this is too basic a question for this group. I have installed ruby > 1.9.1 on my windows 7 pc and have had success using interactive ruby > (and the Windows command prompt). Where I am stuck is creating a script > in notepad and then running that script. It seems a bit peculiar to me > that all the beginning tutorials that I ahave tried just say to create > these scripts, but they don’t mention where they need to be saved. I > also have not come across any tutorials that cover configuring the ruby > file path. I believe I have written and named the scripts properly, but > when I try to open them, I get the error message: > > NameError: undefined local variable or method ‘hello’ for main:Object > from (irb):1 > from C:/Ruby191/bin/irb:12:in ‘
’ > > Any help would be much appreciated. -- Posted via http://www.ruby-forum.com/.