|
Answer» 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 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...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 oh ruby is a file type? i thought it was just a ruby.bat lolQuoteoh ruby is a file type? i thought it was just a ruby.bat lol ruby is a programming language. see here
|