Topic: I'm having an issue with opening Ruby programs

Well i'm on windows and to be honest this is probably a noob question, but i'll admit i'm a noob so here goes. Whenever i try to open one of my .rb files a CMD window pops up briefly and then closes. Is there any reason why this is happening? I can see that the code is executing for the brief second that the window is open. But its especially frustrating that i'm coding a GUI with Shoes and when i try to open it i get the same result. So, please help?

Re: I'm having an issue with opening Ruby programs

No matter which Ruby version you use, you can always open an *.rb file by right-click and choosing 'Edit' option.
If you use Ruby 1.9.2 version installed with Windows installer, you can open it with a normal double click. In both cases, it's Ruby SciTE editor that will be opened by default; If not, you can use Netbeans IDE Ruby version to work with your Ruby files.

Last edited by Javix (2010-12-27 09:17:47)

Re: I'm having an issue with opening Ruby programs

I don't mean open what i mean to say is run when i try to run. It should execute the code in a prompt or something and i think it does but the window only stays open for a split second and then closes. Will Netbeans make something else happen?

Re: I'm having an issue with opening Ruby programs

On Windows, as far as I know, the only solution to RUN ruby files is to do that from inside the terminal window (command prompt). In Netbeans, when right-clicking on the file and choosing 'Run', the file will be executed.

Re: I'm having an issue with opening Ruby programs

oh i see i can't run my files in CMD even though i've tried so should i try Netbeans? Also, will running them from command prompt fix the problem i'm having? or will it just briefly flash in the open prompt and then close? thanks for bearing with me btw big_smile.

Re: I'm having an issue with opening Ruby programs

No, once the command prompt window opened, I don't think it will be closed after running your Ruby file. Try it your self; As for Netbeans, - no problem, it will do it for you.

Re: I'm having an issue with opening Ruby programs

do i have to set a path or anything for me to be able to run a .rb file in CMD because if so i don't know how exactly but i'll try Netbeans and see how that goes