how do you run ruby on windows

E

equinox

Okay so I've downloaded the One-Click Ruby Installer for Windows and
installed it well under C:\Program Files\ruby
and now what do I need to do to use it? I've gone into the command
line and try to execute some commands but it doesn't work.. where do I
need to put the .rb files to?
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

Okay so I've downloaded the One-Click Ruby Installer for Windows and
installed it well under C:\Program Files\ruby
and now what do I need to do to use it? I've gone into the command
line and try to execute some commands but it doesn't work.. where do I
need to put the .rb files to?
Is the ruby binary in your path? Are you typing the following: ruby
file.rb
 
E

equinox

[Note:  parts of this message were removed to make it a legal post.]

Okay so I've downloaded the One-Click Ruby Installer for Windows and
installed it well under C:\Program Files\ruby
and now what do I need to do to use it? I've gone into the command
line and try to execute some commands but it doesn't work.. where do I
need to put the .rb files to?

Is the ruby binary in your path?  Are you typing the following:  ruby
file.rb

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

no it is not in my path, I am using irb as of now.. I have tried to
load it in the irb
but it doesn't work...
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

[Note: parts of this message were removed to make it a legal post.]

Okay so I've downloaded the One-Click Ruby Installer for Windows and
installed it well under C:\Program Files\ruby
and now what do I need to do to use it? I've gone into the command
line and try to execute some commands but it doesn't work.. where do I
need to put the .rb files to?

Is the ruby binary in your path? Are you typing the following: ruby
file.rb

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

no it is not in my path, I am using irb as of now.. I have tried to
load it in the irb
but it doesn't work...

So you are trying to read a source file and execute the code in irb? To do
that you need to type the following in your irb session:

source file_name.rb
 
E

equinox

[Note:  parts of this message were removed to make it a legal post.]



[Note:  parts of this message were removed to make it a legal post.]
Okay so I've downloaded the One-Click Ruby Installer for Windows and
installed it well under C:\Program Files\ruby
and now what do I need to do to use it? I've gone into the command
line and try to execute some commands but it doesn't work.. where do I
need to put the .rb files to?
Is the ruby binary in your path?  Are you typing the following:  ruby
file.rb
no it is not in my path, I am using irb as of now.. I have tried to
load it in the irb
but it doesn't work...

So you are trying to read a source file and execute the code in irb? To do
that you need to type the following in your irb session:

source file_name.rb

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

hmm..I think I need to load the file first right in irb using the load
command?
 
M

Michael Tomer

Just in case you are having trouble with your Windows path variable,
here's how to add a folder to it:

*Go to your desktop and right click "My Computer".

*Select "properties" from the menu.

*Click the "Advanced" tab.

*At the bottom of the window, there's a button labeled "Environment
Variables". Click it.

*There are two listboxes on the window, the bottom one is called "System
variables". Scroll through that box until you come across "Path". Select
"Path" and click the "Edit" button.

*Click the "Variable value" textbox and hit the "End" key on your
keyboard. Type a semi-colon followed by the absolute path to your ruby
bin folder.

Also, you can always check what folder IRB is running in by typing
"Dir.pwd". You can get a list of all the .rb file in the folder IRB is
currently operating in with "Dir.glob('*.rb')". Also, you can change the
path that IRB is operating in with "Dir.chdir('c:\my_ruby_files\')".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top