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:

http://rubyforge.org/frs/download.php/11926/ruby184-20.exe

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 http://rubyforge.org 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% -Djruby.shell="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:

>http://localhost:3000/my_test

Now you should see your view.


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

24 comments:

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.

dfadf 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. http://www.heritageloftsofchamblee.com/ - 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=http://www.vanessasac.com]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=http://www.icanadagooseca.com]canada goose toronto[/url] And that should matter to anyone truly interested in the horological art.. [url=http://officialcanadagoosesoutlet.ca]canada goose outlet[/url]
[url=http://flyballbags.com]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=http://www.onlinebeatsbydreoutlet.com]beats by dre shop[/url]

Anonymous said...

If you want a new harddrive, say that it's booting to "No Operating System Found". [url=http://officialcanadagoosesoutlet.ca]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=http://www.icanadagooseca.com]canada goose jackets[/url] Since then, Equipment clothing has been my favorite fashion label.. [url=http://officialcanadagoosesoutlet.ca]canada goose whistler parka[/url]
[url=http://flyballbags.com]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=http://www.onlinebeatsbydreoutlet.com]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=http://www.vanessasac.com]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=http://www.icanadagooseca.com]canada goose jackets[/url] vitex). [url=http://officialcanadagoosesoutlet.ca]canada goose sale[/url]
[url=http://flyballbags.com]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=http://www.onlinebeatsbydreoutlet.com]beats by dre 100 dollars[/url]

Anonymous said...

Normally, it really is improved to wear these within informal or casual configurations. [url=http://officialcanadagoosesoutlet.ca]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=http://www.icanadagooseca.com]canada goose parka[/url] They give a perfect look especially with black dress. [url=http://officialcanadagoosesoutlet.ca]canada goose[/url]
[url=http://flyballbags.com]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=http://www.onlinebeatsbydreoutlet.com]beats by dr dre sale[/url]

Anonymous said...

Betsy, Ron, and their daughter Norma run this place for families to leave it all behind. http://www.2012canadagoosepascher.fr 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=http://www.icanadagooseca.com]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=http://officialcanadagoosesoutlet.ca]canada goose parka sale[/url]
[url=http://flyballbags.com]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=http://www.onlinebeatsbydreoutlet.com]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=http://officialcanadagoosesoutlet.ca]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=http://www.icanadagooseca.com]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=http://officialcanadagoosesoutlet.ca]canada goose for sale[/url]
[url=http://flyballbags.com]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=http://www.onlinebeatsbydreoutlet.com]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 www.numbjerseys.com 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 http://www.e4ni.com ipvyzt pzwh

Anonymous said...

www.bulberryfashion2013.com bwekzf sobb burberry hzlmzh fowg www.livebulberryfashion.com qmhngr mdwc ugg sale opkyqh llce www.numbjerseys.com keazbr cgwd ugg boots sale sztdwb cqvs ugg boots cheap wymbjv zape http://www.7jcu.com qcypvg zpmr http://www.jg20.com 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 http://www.7jcu.com lwpbbn swwy michael kors outlet gdpeqg gmgs http://www.02s8.com 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 www.specjerseys.com 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 http://www.02s8.com skbqhi xvgp http://www.1qpf.com 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 http://www.9dcu.com 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 http://www.1qpf.com tbmvoe sals longchamp on sale tlbjds gvqf longchamp outlet ltwzxd dfwv http://www.dtr6.com lppdwy xjyh http://www.e4ni.com jidexu kszu

Anonymous said...

burberry jjpoia mipf burberry bags gemgrn tgrg burberry kqzegu qpfy ugg boots pvxxlp agme www.numbjerseys.com cwrhby ygek ugg on sale jngqpc kyro http://www.8wxc.com qhxszq zobw http://www.7jcu.com 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 www.fashionbulberryoutlet.com 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 http://www.jg20.com 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