768x90 Getting Online Shouldn't be Tough- $7.49 .com Domains at Go Daddy

Portable Ruby - As Easy as Ruby did

Hmm.... Ruby is very interesting programing language. I am one of thousands ruby fanatics. I am mobile person, when i am in cyber cafe and want finish my ruby job, i have to install ruby, gems and also database, very tired of work and full wasting time. Let's fight it and make your self more confidence with ruby where ever you are.

"Ruby really made me stronger..." - Bruce Lee - 1970



Let see step by step how to install Portable Ruby to your FlashDisk or USB Drive.
  1. You should have a downloaded ruby installation first. I prefer to use one-click-installer , but dont install it, just download it 'till finish.
  2. Let's Download RubyPortable Template and extract it to your USB Drive or Flashdisk. I advice you to use flashdisk or any mobile drive with space more than 512 MB. Because Ruby will take space 80MB.


  3. Taking from the picture above. Let install one-click-installer to J:/RubyPortable/App/ruby/ , if you see alert message to remove folder ruby, choose 'Yes'.
  4. Honestly, at this way you can use portable ruby. If you want make ruby on rails, you should update gem, you can install also sql portable to support your work or use external database like in webhosting you have. Let's run J:/RubyPortable/RubyPortable.exe and you will get this (if not works, go to step 5)


  5. But because RubyPortable allows saving a lot settings (one or all of them at once):
    - One or more registry keys
    - One or more settings directories
    - One or more settings files
    You can go to the next step.
  6. we Now, let we install plugin for running our RubyPortable and sCite, you should download the following files: NullSoft Installer, HM NIS EDIT(script editor for installer), NewAdvSplash plug-in, Registry plug-in, FindProc plug-in
  7. Install NullSoft Installer and HM NIS EDIT in any folders of your windows.
  8. After you download NewAdvSplash in zip file. Find file with name - filenewadvsplash.dll and copy it to folder plugin where you installed NSIS is.
  9. Extract Registry plug-in and you will get fold desktop, and run install.exe
  10. Now the last step extract and copy FindProcDLL.dll to the NSIS plugins directory.
  11. After you complete all those steps, open your HM NIS editor and open the file RubyPortable.nsi that located in folder J:\RubyPortable\Other\RubyPortableSource.
  12. Closer to the top you will see "Define constants " you can set as you want. If you want this as a default setting, you can compile it as CTRL+F9


  13. Now Your Portable Ruby can be used. You can install rails or gem. To edit ruby file you can use Scite Or Notepad :p
  14. For more information : In most cases, all you would need to do is update the constant definitions at the top of the script. Based on these values, the created launcher can make changes to the system registry or settings, launch the target program, and restore the registry and settings to their original values when the program closes.

    I prefer to avoid changing the registry or system settings at all costs so as not to cause any problems on the host PC should problems arise. Our problem then becomes, how do we open a command window with the PATH environment variable correctly set when the PATH is a value maintained in the Windows Registry.

    A simple option would be to set the value of the constant "EXE" in the script to reference a file named "bin\ruby.cmd". This file doesn't exist in the Ruby distribution but we could create one that then opens a new command window with arguments for setting the PATH. We can also go ahead and update our script to perform the same action. Here is the updated entry in RubyPortable.nsi (line 395) which will do that.

ExecWait "$SYSDIR\cmd.exe /K set PATH=$EXEDIR\App\${APP}\bin;%PATH%"



References:
http://ruby.about.com/od/resources/ss/portable_ruby.htm
http://portableapps.com/node/2022

No Response to "Portable Ruby - As Easy as Ruby did"

 
powered by Blogger