![]() | code puts 1 + 2 |
|
16 Jul 2011, 13:48
shiloh speights (3 posts) |
If any one has the problem with the code puts 1 + 2 on the second chapter of learn to program…Well I found a solution. go into your text editor and then type puts 1 + 2 of course. Then go to your command propt then type cd desktop and then get you program out of the folder and then run the program the way that chris pine told you to do it. ruby ( than your program name ) |
|
24 Sep 2011, 14:59
Bogdan Vinnarlund (2 posts) |
Hi, I too have this problem, but nothing seems to work. I downloaded Ruby and saved it in C>Programs, but TextEditor wasnt inside like the book described. So I had to download it manually and I did, Scintilla text editor (SciTe). I clicked on it and I made 1+2 program and saved it in my “user” psace in a file I named “Ruby Programs”. I named it calc.rb just like the book says. I runned “Command prompt with Ruby” just like the book says. But I got this message “Ruby is not an itern commando, extern commando, programm or a commando file”. I checked on the internet and found that the program and ruby should be in the same file so I moved ruby from programs and in to “Ruby Programs”-file, and it still displays the same error. This is how it looks when I open commando prompt: Then I write in “ruby calc.rb” so it looks like this: and I press Enter />Can not find the searchway I do not know what I am doing wrong. Should I try and delete it all and reinstall all the components? I do not know how to fix this, I have been following the book on the spot. I have been wanting to learn how to programm for years and now when I finally have some time to do it I got stuck on the first assignment. Please, please help. Regards |
|
26 Sep 2011, 10:47
Chris Pine (38 posts) |
Sounds like Ruby was not installed properly. The path to the Ruby executable needs to be in your PATH variable (but this should happen on installation). Reboot your computer, and try again. If that doesn’t work, uninstall and reinstall Ruby. If that doesn’t work, then you’ll need to add the path to ruby.exe manually to your PATH variable (which you can Google about). Hope that helps, Chris |
|
18 Oct 2011, 17:10
Bogdan Vinnarlund (2 posts) |
Thanks, I understood what the problem was and am now geting through your book Chris. I have another question, I wanted to make a separate topic, but I dont really see how it is done on this website. three = 3 I get (11.rb is the name of my file): 3 I would be very thankful if anyone could explain why I am geting that error. It is perhaps not so important as I can go on without it, but I would still like to know. Regards |
|
18 Oct 2011, 19:32
Chris Pine (38 posts) |
I think you must just be using a different version of Ruby, and they must have changed this behavior. It’s not a big deal (as you’d never write code like this anyway), so I’d just ignore it and move on. |
|
13 Feb 2012, 18:24
Eddie Robbins (2 posts) |
can you give an example of what c:\users\eddie.robbins\ |
| You must be logged in to comment |

