install jruby on windows win32
Posted by superuser
In a previous post i described how to install ruby 1.8 and 1.9 on win32 platforms using the rubyinstaller.
Here i’ll show you how to install one more implementation of ruby on win32 platforms (Windows XP / 7 tested!). I’m talking for jruby.
What is JRuby?
JRuby is a ruby implementation for the java virtual machine. You can execute all your ruby stuff using only the Java Virtual Machine(JVM), in the same way that Groovy, Scala, and Clojure are designed for the JVM.
This is incredibly useful because your unix admin rarely will install a Ruby VM for your needs in a server where there is nothing more than Java. I really love ruby and i have no time to master java, so jruby it’s a GREAT solution.
Jruby – at the moment – is the only solution to deploy a Ruby app on GAE (Google App Engine).
Installation
- Extract in your favorite place (i use C:\jruby-1.4.0)
- Set JRUBY_HOME variable in your jruby home dir (C:\jruby-1.4.0)
C:\>set JRUBY_HOME=C:\jruby-1.4.0
- Add JRUBY_HOME\bin in your environment path
C:\>path=%JRUBY_HOME%\bin;%PATH%
Check that C:\jruby-1.4.0\bin has been added in your path:
C:\>echo %PATH% C:\jruby-1.4.0\bin;C:\Python25;C:\Ruby\bin;C:\MinGW\bin;c:\ora92\ bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Support Tools\;C:\j2sdk1.4.2_17\bin\;
That’s all! You’re ready to use your new ruby implementation in JVM.
C:\>jruby -v jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) C lient VM 1.6.0_16) [x86-java]
Commands in Jruby: All the known commands in ruby are still valid, but you have to preceed them with jruby -S.
- Execute: jruby -S
C:\>jruby -S myprogram.rb
- Gem:
C:\>jruby -S gem install rack
- irb now is called jirb:
C:\>jirb
irb(main):001:0>





