Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: create a batch file to run ruby.exe and compile a  (Read 6514 times)

0 Members and 1 Guest are viewing this topic.

tuhin_cse99

  • Guest
create a batch file to run ruby.exe and compile a
« on: March 01, 2007, 02:03:22 AM »
Dear guys,
                  I have instainsRails in my PC. i have written a ruby programm. now i want to compile it by ruby.exe. suppose its directory is c:/instantsRails/ruby/bin/ruby.exe and my file is in c:/myfile.ruby. so hoe can i create a bat file which can run ruby and compile my file?


Amin  

lordoftheplat



    Hopeful

  • teh god.
  • Thanked: 1
    Re: create a batch file to run ruby.exe and compil
    « Reply #1 on: March 01, 2007, 03:54:36 AM »
    ok i dont really get you but
    if u wanna compile it with batch i dont think it is possible unless u use
    bat2exe.com(1990 verion) SO DONT EXPECT IT TO WORK!

    ok about opening ur ruby.exe


    @echo off
    echo ruby launcher
    pause
    start c:/instantsRails/ruby/bin/ruby.exe


    and that will start ruby.exe and i u use bat2exe
    u have to put ur ruby .exe and bat2exe into C:\ because its the easiest
    and the code will be

    @echo off
    echo compile
    pause
    call bat2exe.com ruby.bat


    that will compile ur ruby batch
    and if u wanna do both in one batch file

    @echo off
    echo compile
    pause
    call bat2exe.com ruby.bat
    pause
    start c:/ruby.exe


    im still not quite sure wad u mean but that should be it...
    zepperblood.deviantart.com

    ghostdog74



      Specialist

      Thanked: 27
      Re: create a batch file to run ruby.exe and compil
      « Reply #2 on: March 01, 2007, 05:57:39 AM »
      Quote
      Dear guys,
                        I have instainsRails in my PC. i have written a ruby programm. now i want to compile it by ruby.exe. suppose its directory is c:/instantsRails/ruby/bin/ruby.exe and my file is in c:/myfile.ruby. so hoe can i create a bat file which can run ruby and compile my file?


      Amin  
      when you installed ruby, it should have modified your PATH to include where ruby.exe is located. if not, you can manually add the path to your environment. Next time you run your ruby script, you can just change directory to c:\ and execute the script from there.eg c:\> ruby.exe myfile.ruby. this should run, even though ruby.exe is not in C:\.
      And so, your batch file should look something like

      Code: [Select]
      c:
      ruby myfile.ruby
      « Last Edit: March 01, 2007, 05:59:26 AM by ghostdog74 »

      lordoftheplat



        Hopeful

      • teh god.
      • Thanked: 1
        Re: create a batch file to run ruby.exe and compil
        « Reply #3 on: March 01, 2007, 06:53:04 AM »
        oh ruby is a file type?
        i thought it was just a ruby.bat lol
        zepperblood.deviantart.com

        ghostdog74



          Specialist

          Thanked: 27
          Re: create a batch file to run ruby.exe and compil
          « Reply #4 on: March 01, 2007, 07:50:57 AM »
          Quote
          oh ruby is a file type?
          i thought it was just a ruby.bat lol
          ruby is a programming language.
          see here