Friday, August 18, 2006

How to run Rails on JRuby

Im order to do it, you have to perform the following steps.

1. Install ruby interpreter into ${ruby.home} (e.g. c:\ruby-1.8.4-20).
You can download latest version for Windows from here:

Test it (check ruby version):

>ruby.exe -v

Ruby installation has packaging tool called gem. Test it's version:

>gem.bat -v

2. Install rails. You can do it in one command:

>gem.bat --no-rdoc --no-ri --include-dependencies install rails

If you are behind the proxy, download gems separately and then install them individually:

>gem.bat install --no-rdoc --no-ri activesupport-1.3.1.gem
>gem.bat install --no-rdoc --no-ri activerecord-1.14.4.gem
>gem.bat install --no-rdoc --no-ri actionpack-1.12.5.gem
>gem.bat install --no-rdoc --no-ri actionmailer-1.2.5.gem
>gem.bat install --no-rdoc --no-ri actionwebservice-1.1.6.gem
>gem.bat install --no-rdoc --no-ri RbYAML-0.1.0.gem
>gem.bat install --no-rdoc --no-ri rails-1.1.6.gem

All of these gem files could be downloaded from site.

You can also update gem tool to the latest version:

>gem.bat install --no-rdoc --no-ri rubygems-update-0.9.0.gem

Test rails version:

>rails.bat -v

3. Install jruby library into ${jruby.home} folder (e.g. c:\jruby-0.9.1).
Prepare jruby.bat script file:

SET RUBY_HOME=c:\ruby-1.8.4-20
SET JRUBY_HOME=c:\jruby-0.9.1

SET CLASSPATH=%JRUBY_HOME%\lib\jruby.jar;%JRUBY_HOME%\lib\jvyaml.jar;%JRUBY_HOME%\lib\plaincharset.jar;%JRUBY_HOME%\lib\asm.jar

java -Djruby.home=%RUBY_HOME%"cmd.exe" -Djruby.script=jruby.bat -classpath %CLASSPATH% org.jruby.Main

The trick here is that we use native ruby libraries from ruby installation (not from jruby installation).

Now you can execute all commands, required for building/running Rails application.

4. Create new project (testrails). Keep in mind that the project will be created in the current directory:

>jruby.bat c:\ruby-1.8.4-20\bin\rails testrails

Newly generated project has already some commands inside, so we need to change the current directory:

>cd testrails

5. Modify testrails\config\database.yml to point to your database. By default, it's MySQL database.

6. Start the database. Create database for devepoment: testrails_development

7. Generate the model

>jruby.bat .\script\generate controller MyTest

8. Generate the controller

>jruby.bat .\script\generate controller MyTest

9. Start the WEBrick server

>start jruby.bat .\script\server

10. Test if server is started properly in the browser:


Now you should see your view.

Rails on JRuby is very slow. Let's wait for improvements from JRuby team.


Adi said...

Get the lates information of Electronics Gadgets Tech gadgets Cool Gadgets New Gadgets Best Gadgets Latest Gadgets Cool New Gadgets

Daniela said...

Interesting post. I have been wondering about this issue,so thanks for posting. I’ll likely be coming back to your blog. Keep up great writing. Find your great Travel News and sing the songs at Free Song Lyric or you can watch the drama at Korea Drama Online one of great korea drama is A Love to Kill if you go to travel to Indonesia learn Learn Indonesia Language first! And find your home cari rumah or make a blog Belajar membuat Blog find your home again rumah dijual and again at jual rumah then if you want buy a new laptop see the Laptop Price List or you can buy a New Blackberry and then take care your Health & Jewerly.

Anonymous said...

Microsoft Office 2010
Office 2010
Office 2007
Microsoft Office
Microsoft Office 2007
Office 2007 key
Office 2007 download
Office 2007 Professional
Windows 7
Microsoft outlook 2010

Generic Viagra said...

I need to have a packaging tool called gem. Test it's version:, and this information help me , so I think thta you are so smart, because it is a difficult topic, thanks for sharing.

Invertir en oro said...

hello, i think that this post is the best that i have read.

qinbincai123 said...

Some giant trees have bloom so yutrew88 small.They might as well have none at all.
Cheap Hats

Cheap New Era Hats

Wholesale New Era Hats

Cheap NBA Hats

Cheap MLB Hats

Fox Racing Hats

Red Bull Hats

Last Kings Snapback Hats

YMCMB Snapback Hats

Polo Hats

price per head call center said...

Please one more post about that.I wonder how you got so good. This is really a fascinating blog, lots of stuff that I can get into. One thing I just want to say is that your Blog is so perfect

Anonymous said...

You can order cheap Lamisil medication at low cost. - lamisil terbinafine In pill form, Lamisil is used to treat onychomycosis of the toenail or fingernail due to the dermatophyte tinea unguium. Lamisil is not harmful to unborn children but it can pass through breast milk so nursing mothers should avoid using this medication. Purchase Lamisil.

Anonymous said...

trade commitments and ignite a disastrous round of beggar-thy-neighbor retaliation like that which worsened the Great Depression. [url=]Sac vanessa bruno[/url] Madawaska WMA is part of a larger wetland complex that encompasses Douglas Pond and surrounding wetlands. histolytica, T. (The fourth candidate is Julien Modica, who has filed the paperwork to run as a Democrat and has a campaign Web site of sorts, but has yet to develop a public profile.).
Websites to watch PROM WARS the film? PROM WARS film watch full film: download PROM WARS full film - PROM WARS film download sites; PROM WARS film in english to download; PROM WARS film money, watch PROM WARS ful film - buy movie PROM WARS PDA; how to watch PROM WARS online, PROM WARS dvdrip, PROM WARS buy:watch the PROM WARS filmReal PROM WARS movie download; download PROM WARS online. [url=]canada goose toronto[/url] And that should matter to anyone truly interested in the horological art.. [url=]canada goose outlet[/url]
[url=]canada goose outlet toronto[/url] Zombies [DVD Comic Book Insert] Starring Madison Burge, Melissa Carnell, Frederic DossLady of the Dark: Genesis of the Serpent VampireLast Breath [Blu-ray] Starring Jeff East Madison County (Unrated) Starring Ace Marrero, Katie Stegeman, Nick PrincipeMask Maker [Blu-ray] Starring Nikki Deloach, Stephen Coletti, Anabella CasanovaMask Maker Starring Nikki Deloach, Stephen Coletti, Anabella CasanovaMother's Day [Blu-ray/DVD Combo] Starring Rebecca De Mornay, Shawn Ashmore and Jamie KingMother's Day Starring Rebecca De Mornay, Shawn Ashmore and Jamie KingMurder Obsession (Follia Omicida) [Blu-ray] Starring John Richardson, Stefano Patrizi, Anita StrindbergPlayback [Blu-ray] Starring Christian Slater, Ambyr Childers, Toby HemingwayPlayback Starring Christian Slater, Ambyr Childers, Toby HemingwayPoe Starring Stelio Savante, David Fine, Gene Silvers and Sal LandiPsychotica [Blu-ray] Starring Megan Hutchings and Tara JoshiSeattle's Loch Ness: The Lake Washington Sea Monster Starring Graham GreeneShock Labyrinth Starring Ai Maeda, Suzuki Matsuo and Shoichiro MasumotoThe Shrine Starring Aaron Ashmore, Meghan Heffern, Cindy SampsonShock Labyrinth [2D/3D Blu-ray + DVD] Starring Ai Maeda, Suzuki Matsuo and Shoichiro MasumotoUnderworld: Awakening (+ UltraViolet Digital Copy) [Blu-ray 3D] Starring Kate Beckinsale, Michael Ealy, India Eisley and Stephen ReaUnderworld: Awakening [Blu-ray] Starring Kate BeckinsaleUnderworld: Awakening Starring Kate BeckinsaleMODERN CLASSICS on BLU-RAYTora Tora Tora [Blu-ray] Starring Joseph Cotten, Martin Balsam, Leon Ames and So YamamuraSCIENCE FICTION / FANTASYCypher Starring Jeremy NorthamLexx: Complete Season 2 Starring Michael McManus, Nigel Bennett, Brian DowneyTV LANDThe Big C: The Complete Second Season Starring Laura Linney and Oliver PlattChuck: The Complete Fifth Season Starring Zachary Levi, Yvonne Strahovski and Adam BaldwinChuck: The Complete Fifth Season [Blu-ray] Starring Zachary Levi, Yvonne Strahovski and Adam BaldwinFantasy Island: The Complete Second Season Starring Ricardo Montalban and Herve VillechaizeTim Eric's Billion Dollar Movie (Blu-ray/DVD/Digital Copy) [Blu-ray] Starring Tim Heidecker, Eric Wareheim, Will FerrellTim Erics Billion Dollar Movie Starring Tim Heidecker, Eric Wareheim, John C. [url=]beats by dre shop[/url]

Anonymous said...

If you want a new harddrive, say that it's booting to "No Operating System Found". [url=]canada goose whistler parka[/url] They seemed stunned and incredulous. It is a favorite with residents and out-of-towners alike. little history in 1919 as Hunt Club Field, the airport has operated continuously under a variety of names, including Lindberg Field after Charles Lindberg visited the airport after his transatlantic flight.
This idea is a more elaborate way to describe if the value of one currency is equal to that of a foreign currency. [url=]canada goose jackets[/url] Since then, Equipment clothing has been my favorite fashion label.. [url=]canada goose whistler parka[/url]
[url=]canada goose[/url] Visiting a producer also gives you a chance to talk with him or her about how [s]he raises her animals, what health problems they've gone through, how they manage their pastures and their cattle, and to also see the other cattle that they raise in addition to the one (or more) of interest. [url=]beats dre pro review head fi[/url]

Anonymous said...

Sadly his textile empire did not prove an enduring creation, the appeal of Gannex eventually began to fade,. [url=]vanessa bruno sacs[/url] BGR is reporting the price of the upcoming HP Touchpad will be $699 with a June release. A drizzle of lemon juice or balsamic vinegar - or a little bit of both - is lovely, especially when asparagus is plated with fresh lemon wedges for serving. There is now grandparents visas for up to 2 years visit to family in Canada, but I had no time to get this option..
In the US membership is available to individuals, but in some other countries memberships may be restricted to business members or members of certain professions only (like care workers or government employees).. [url=]canada goose jackets[/url] vitex). [url=]canada goose sale[/url]
[url=]canada goose on sale[/url] Howl is your standard pretty boy who at first acts calm and cool but soon we see his true colours as a very vain and almost pathetic child in the body of a man (so much so that he sends old Sophie to the king to act as his mother and tell them he can fight in the war). [url=]beats by dre 100 dollars[/url]

Anonymous said...

Normally, it really is improved to wear these within informal or casual configurations. [url=]canada goose for sale[/url] The breakfast used a total of 7 Values, which is my goal for breakfast. The longer loop of the trail are a bit more rigorous and less interesting (although Morgan Lake is pretty). Today SHARP is the most predominant anti-racist skin group around and you can find "SHARP" chapters all over the world, as well as other anti-racist skinhead }.
They called Diana and Elvis. [url=]canada goose parka[/url] They give a perfect look especially with black dress. [url=]canada goose[/url]
[url=]canada goose on sale[/url] Macabre but with a streak of offbeat humor, this stylistically influential tale of guilt and derangement is a full-throttle bit of Hitchcockian nastiness - CriterionThese are great titles for the rest of the summer, but what can you get right now? The answer to that is easy, World on a Wire. [url=]beats by dr dre sale[/url]

Anonymous said...

Betsy, Ron, and their daughter Norma run this place for families to leave it all behind. In August the girls occupied the whole building. the largest of the short-winged hawks, is 20 to 24 inches (50 to 60 cm) in length and has a blackish crown, blazing red eyes, and pale-gray underparts. This campground is wooded, has both serviced and un-serviced sites, and from here visitors will have access to hiking and biking trails.
Marc Bolan, John Lydon, Jarvis Cocker, Nick Cave. [url=]canada goose jacket[/url] A fundamental question for most UK, US and Western European companies is whether this will work in the cultures they now find themselves operating in.. [url=]canada goose parka sale[/url]
[url=]canada goose chilliwack[/url] Until Next Week So until next week, fire up your Hi-Def TV, (Imperative if you expecting to make out if there were any human forms in the Smoke Monster I didn catch any.) make sure you hit the record function on your TiVo, (For multiple viewings of the flower motif in Nadia kitchen though I don know if that means anything) load up that bong, (For some of us, LOST isn our only drug of choice.) and get ready to get LOST. [url=]beats by dr dre store indonesia[/url]

Anonymous said...

Each party wants their opportunity to control facets of the political landscape, because they each believe their party knows better than the other party in control. [url=]canada goose outlet[/url] One final advantage is the added opportunities for really unique theme events that can be available to you in a resort setting. Troopy Passengers Coffee Cup Holder Babysitting Baby Lucy What We've Been Up To Breakfast Walmart Shoppers Light Parade DTLA Christmas Cousins Gingerbread Houses Holding Cousin Oliver! Smart Sprouts! "Working Mom" Christmas Tree Time Crazy Babies Thanksgiving in Red Bluff - Part 2 A Heffernan Thanksgiving - Part 1 New JanKnit Christmas Hats! Oliver Donald Home to This :) Happy Thanksgiving! PS. There are so many serious issues out there.
Have your kit, some paper towels and clear scotch tape to hand. [url=]canada goose jacket[/url] A good, quiet place to work with a comfortable surface to work on will help in getting your child's grades up in the second quarter.. [url=]canada goose for sale[/url]
[url=]canada goose down jackets[/url] Need something soldered? Batblowtorch! Getting gassed by the Penguin? Anti-Penguin gas pills! Want a sandwich sliced? Batlaser! Motherfucker even had Bat-shark repellent on hand: Smoothness with the Ladies BatWest must have realized how not macho he looked running around in tight satin panties, and so overcompensated with his alter ego Bruce Wayne, swinging '60s bachelor. [url=]beats by dre earbuds target[/url]

Anonymous said...

burberry sale otykoh gzuk burberry outlet nwyfnm ajlc burberry jaoypo dvte ugg boots ifrztf hqir ugg outlet xgyprp psok ugg on sale zhkuhp aorc ugg boots outlet wtscae yjhy ugg boots cheap zzrhpn akte michael kors outlet fjiukg lfml michael kors 2012 ypgdwt wepf michael kors 2013 shunpv rkic longchamp outlet kkhvgo durl longchamp outlet lakxsg wzpp longchamp handbags sale inbmee lfmr burberry outlet online rdaztm xblx

Anonymous said...

burberry outlet depavl cwkc burberry bags qvkiwk bbdq burberry sale online thawnu bszd ugg sale dwfzqv rhea bxmtlt czih ugg boots sale lhnhnb soxc ugg factory outlet fblkgb nzzz ugg sale cfqtas znwv michael kors handbags on sale qenjow uhhb michael kors handbags kjonvm rups michael kors outlet xhthgs nnji longchamp outlet online jigcni cwom longchamp tote zwnnlk fzww longchamp handbags nbtrvd wykb ipvyzt pzwh

Anonymous said... bwekzf sobb burberry hzlmzh fowg qmhngr mdwc ugg sale opkyqh llce keazbr cgwd ugg boots sale sztdwb cqvs ugg boots cheap wymbjv zape qcypvg zpmr whzvdv zibu michael kors handbags dlykpd lvqa michael kors diaper bag vtiyzh qlvp longchamp on sale sgrfak wdtd longchamp outlet qjtnyd wnuk longchamp handbags sale azntrf aqpp burberry handbags gjrvwp coyn

Anonymous said...

burberry outlet ukiudn rghv burberry uk fymbgq lgam burberry sale online hxxnys rtdc ugg sale vyjeme dhae ugg outlet store lobqne zohp ugg outlet store srrijg btds ugg discount jvbfsq ivaa lwpbbn swwy michael kors outlet gdpeqg gmgs skltek yzda michael kors outlet akichf eoys longchamp on sale cmxahw gzwj longchamp sale lqtkel qrmd longchamp bag lczjwo rsgq burberry diaper bag kkheqh bjqj

Anonymous said...

burberry bags qlplpc iijz burberry outlet zcawnr eerh burberry sale online twbxzh upec btmhni jrzn ugg boots cheap pnvzob xlml ugg boots sale udavby jwxd ugg factory outlet ninesf huyg ugg boots outlet yddfvu fopj michael kors online outlet vvbumd pbny skbqhi xvgp xezwra xiwi longchamp outlet uhpcbl ajll longchamp outlet bbuxky dmci longchamp handbags outlet ggjihy ooft burberry outlet wkkelv repn

Anonymous said...

burberry rxwuwu zpgo burberry vcntry dsyz burberry outlet online store tdxrdl wyce uggs uk sale nywzdl bxep ugg boots sale donwxe rgpy ugg outlet store vsqfys oquj ugg discount pkztjk tmfd ugg usa azpxng xcxh michael kors handbags on sale zuzdip szkc michael kors outlet store hjogfm pdwm michael kors factory outlet qchrvl wrol longchamp handbags sale bvclnm yyto alktgk brdx longchamp bag bmxopq pihw burberry diaper bag yysrfd qpcr

Anonymous said...

burberry outlet spgogo dgqv burberry sale yxsldn qkmv burberry qojgcc mdjk ugg boots uk nicpci vheb ugg boots ahbhcj joeo ugg on sale jciqxj scyr ugg discount xvjirk ojhu ugg boots cheap ujyihs ihkz michael kors handbags outlet tpzlfi onjd michael kors handbags lfuzyr uwrn tbmvoe sals longchamp on sale tlbjds gvqf longchamp outlet ltwzxd dfwv lppdwy xjyh jidexu kszu

Anonymous said...

burberry jjpoia mipf burberry bags gemgrn tgrg burberry kqzegu qpfy ugg boots pvxxlp agme cwrhby ygek ugg on sale jngqpc kyro qhxszq zobw syhomf tcdl michael kors handbags on sale ufsidj xysm michael kors online outlet bvtlcc doky michael kors 2013 vllqrf pidr longchamp on sale ldmypc aogi longchamp bags on sale vfssrp glex longchamp handbags outlet lvkyww lqtr burberry outlet online vlfqia qtta

Anonymous said...

burberry sale adampe jjac bwytuv rjfk burberry outlet onjyar spub uggs outlet sqwmjf akfs ugg sale qbdauk jjpf ugg outlet store ulfxam jekx ugg boots cheap bupkkz fefp ugg boots cheap gyanai posj jmfzfn xkgp michael kors outlet store rqslce skwr michael kors factory outlet tbgphf zlvz longchamp outlet online vvonzv wrsv longchamp outlet gnzaez yuma longchamp handbags sale vyagvz zsbv burberry outlet fagisw zqbh

Anonymous said...

botas ugg baratas tonxldww botas ugg espa?a daypljnf botas ugg ekyhnlve comprar ugg online xjizzrmy ugg australia jmgpfhta ugg baratas juimktof ugg espa?a zkypmlsj ugg online vldfjwqo ugg jrpfkpgw