how do you run ruby on windows

Discussion in 'Ruby' started by equinox, Nov 19, 2008.

  1. equinox

    equinox Guest

    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?
    equinox, Nov 19, 2008
    #1
    1. Advertising

  2. equinox

    Glen Holcomb Guest

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

    On Wed, Nov 19, 2008 at 2:31 PM, equinox <> wrote:

    > 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)
    Glen Holcomb, Nov 19, 2008
    #2
    1. Advertising

  3. equinox

    equinox Guest

    On Nov 19, 2:41 pm, Glen Holcomb <> wrote:
    > [Note:  parts of this message were removed to make it a legal post.]
    >
    > On Wed, Nov 19, 2008 at 2:31 PM, equinox <> wrote:
    > > 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...
    equinox, Nov 19, 2008
    #3
  4. equinox

    Glen Holcomb Guest

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

    On Wed, Nov 19, 2008 at 2:46 PM, equinox <> wrote:

    > On Nov 19, 2:41 pm, Glen Holcomb <> wrote:
    > > [Note: parts of this message were removed to make it a legal post.]
    > >
    > > On Wed, Nov 19, 2008 at 2:31 PM, equinox <> wrote:
    > > > 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

    --
    "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)
    Glen Holcomb, Nov 19, 2008
    #4
  5. equinox

    equinox Guest

    On Nov 19, 3:19 pm, Glen Holcomb <> wrote:
    > [Note:  parts of this message were removed to make it a legal post.]
    >
    >
    >
    > On Wed, Nov 19, 2008 at 2:46 PM, equinox <> wrote:
    > > On Nov 19, 2:41 pm, Glen Holcomb <> wrote:
    > > > [Note:  parts of this message were removed to make it a legal post.]

    >
    > > > On Wed, Nov 19, 2008 at 2:31 PM, equinox <> wrote:
    > > > > 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
    >
    > --
    > "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?
    equinox, Nov 19, 2008
    #5
  6. 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\')".
    --
    Posted via http://www.ruby-forum.com/.
    Michael Tomer, Nov 20, 2008
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doris Cox
    Replies:
    0
    Views:
    543
    Doris Cox
    Dec 2, 2003
  2. Dennis
    Replies:
    0
    Views:
    690
    Dennis
    Dec 2, 2003
  3. Dennis
    Replies:
    0
    Views:
    447
    Dennis
    Dec 2, 2003
  4. Ramon F Herrera
    Replies:
    6
    Views:
    669
    Ramon F Herrera
    Nov 11, 2007
  5. 3lionz Wexler
    Replies:
    2
    Views:
    658
    Suraj Kurapati
    Aug 24, 2010
Loading...

Share This Page