Wednesday, October 24, 2007

Debugging a JRuby on Rails app with jruby-debug and NetBeans

We've been working on the java port of ruby-debug for awhile and it's getting perilously close to usable. And with the latest builds of NetBeans, you can actually use the NB ruby debugger with it. If you're very brave, you can try it for your yourself. Be warned, it's still a work in progress, but here's how to get started:

  1. Check out jruby from trunk and build it. You'll need java and ant, but if you're interested in jruby chances are good you have those already. It's super easy to build, check it out from http://svn.codehaus.org/jruby/trunk and do ant dist and you're good to go.
  2. Check out jruby-debug from http://debug-commons.rubyforge.org/svn/jruby-debug/trunk. In this directory, do rake install_gem. This will compile and build a jruby version ruby-debug-base, which ruby-debug (command line rdebug debugger) and ruby-debug-ide (which NetBeans and Eclipse use) both depend on.
  3. Check out ruby-debug-ide from http://debug-commons.rubyforge.org/svn/trunk/ruby-debug-ide. Then do a rake gem to build the gem and gem install pkg/ruby-debug-ide-0.1.8.gem to install it.
  4. Grab a copy of NetBeans daily builds ruby ide from here: http://deadlock.netbeans.org/hudson/job/ruby/
  5. Fire up NetBeans like with some extra command line switches: ./netbeans -J-Dorg.netbeans.modules.ruby.debugger.force.rdebug=true -J-Dorg.netbeans.modules.ruby.debugger.fast.not.required=true
    The first tells NetBeans to always use the fast debugger even tho the classic debugger is what appears selected in the UI. The second tells NB to ignore the fact that the classic debugger is selected and allow us to debug a rails app anways. These flags were just added to allow us to play with jruby-debug in NetBeans for now, they won't be necessary once jruby-debug matures a little and full support for it comes into NB.
  6. In NetBeans Tools | Options be sure and have your ruby interpreter pointing at the jruby you built from trunk in Step 1.
You should now be able to debug Ruby and ROR apps using the fast ruby debugger inside of jruby. Like I said, this is all very experimental. All these steps will go away in the next few weeks or months and jruby-debug, jruby, NetBeans, ruby-debug-ide do releases.

Things which seem to work ok:
  • setting breakpoints
  • looking at variables (global and local)
  • watches
A little flaky (tho it may already be fixed by the time you read this):
  • Stepping over some code in Rails
  • Stepping out of a method
Finally, big time kudos to Martin for kicking this whole thing off and Peter for knocking out bugs and implementing more features every hour just about. It's definitely looking close now.

26 comments:

Pavel said...

Hi, just trying to get this up and running, and cannot really get it work with NB 6.0 final. on Mac OSX Tiger platform. Can you please provide step-by step on how to actually enable ANY debugging in JRUBY. Simply none of the approaches I tried seems to work, NB always comaplin that they cannot debug JRUBY.

Thanks for advice.

wow gold said...

Weekends to peopleig2tmean that they can have a two-day wowgold4europe good rest. For example, people gameusdcan go out to enjoy themselves or get meinwowgoldtogether with relatives and friends to talk with each storeingameother or watch interesting video tapes with the speebiewhole family.
Everyone spends agamegoldweekends in his ownmmoflyway. Within two days,some people can relax themselves by listening to music, reading novels,or watchingogeworld films. Others perhaps are more active by playing basketball,wimming ormmorpgvipdancing. Different people have different gamesavorrelaxations.
I often spend weekends withoggsalemy family or my friends. Sometimes my parents take me on a visit to their old friends. Sometimesgamersell I go to the library to study or borrow some books tommovirtexgain much knowledge. I also go to see various exhibition to broadenrpg tradermy vision. An excursion to seashore or mountain resorts is my favorite way of spending weekends. Weekends are always enjoyable for me.
igxe swagvaultoforu wowgold-usaignmax wowgoldlivebrogame thsaleGoldRockU

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa

Frederick Milton said...

I don't know if I brave enough to try it out but I will give a try. Specially that I think that it is better when everything it is build in the program. I want to finish my new program and upload it to Generic Viagra.

Buy Viagra Viagra Online

aiya said...

Office 2010is powerful!
Microsoft Office 2010is the best software in the world.
Microsoft wordis so great!
Office 2007makes life great!
Many people likeMicrosoft Office.
Microsoft Office 2007is welcomed by the whole world.
Office 2007 keyis available here.
Office 2007 downloadis on sale now!
Office 2007 Professionalbring me so much convenience.
Outlook 2010 make life wonderful!
Microsoft outlook is my love.
Microsoft outlook 2010 is convenient!
Windows 7 is convenient!

teramoney said...

Tera gold
wow gold

Tera gold
Tera Item
Tera account

buy eden gold
Runescape gold
buy Runescape gold

Adim said...

Super-Duper site! I am loving it!! Will come back again - taking you feeds also, Thanks.
Personal Care Logo

Miller Yu said...

Simply none of Diablo III itemsthe approaches I tried seems to work, NB always comaplin that they cannot Buy Guild Wars 2 Golddebug JRUBY.

summerlijia said...


The legendary doomsday is around the corner, so who do you want to be together in your last minutes of life? Do not leave any regrets and enjoy yourself as much as possible. I plan to play diablo 3 games all day. Buy diablo 3 gold to do diablo 3 power leveling. Do you want to join me?

SevenIna said...

We supply all WOW Gold services. wow gold We provide all WOW Gold & WOW Power Leveling services. You can buy wow gold, home to the cheapest cheap gold for wow cheap wow gold and Buy World of Warcraft Gold here. Enjoy a better game experience; you should better have large number of wow US gold! buy wow gold Cheapest wow gold are provided by lorland.

Anish Ahmad said...

Good information here. I really enjoy reading them every day. I’ve learned a lot from them.Thanks so much for sharing this information. Greatly help me being a newbie.
raspberry ketone review | raspberry ketone supplements | raspberry ketone benefits

Anish Ahmad said...

The post is written in very a good manner and it entails many useful information for me. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept.
buy raspberry ketones | where to purchase raspberry ketone | raspberry ketone reviews

Singer Lee said...

This article is fantastic. I really like studying your articles. rs accounts for sell Stay up the great work! Lots of persons are hunting around for this information, you could help them greatly.

rsgoldorder said...

Again fantastic submit. Come on and blogging your website may well be more attractive. I always enjoy the
interviews. I'm a editor of game site, you can visit and find diablo 3 gold, i like it very much.

Phillips Carson said...

This member of WOW Alliance consists of guild wars 2 gold four Gnome racial traits such as Escape Artist, Expansive mind, Arcane Resistance and Engineering Specialization. These traits symbolize the Gnomes are appropriate to the roles of a Mage, Rogue but can also play as a Warrior or Warlock on www.gw2farm.com

AntoL-Nyo said...

HD kaliteli porno izle ve boşal.
Bayan porno izleme sitesi.
Bedava ve ücretsiz porno izle size gelsin.
Liseli kızların ve Türbanlı ateşli hatunların sikiş filmlerini izle.
Siyah karanlık odada porno yapan evli çift.
harika Duvar Kağıtları bunlar
tamamen ithal duvar kağıdı olanlar var

dolinna said...

That is really cool. Thanks for finding it. Some really good ideas there, this is going to be a real time sink. I am a china tour lover,You can learn more: China tour operator | China tour packages | China city travel

nongfu380 said...

I all the time emailed best cheap android phones this website post page to all my contacts, for the reason that if like to readit next my links will too.

alberta11 said...

Weedends is great day! I really love it! Because in this day, not only can I get up late, but also I can be relaxed!!~None day can be better than weedends! There is Günstiges android-Handy ohne Vertrag online kaufen a important reason that we can't go to school or go to job! So happy day!

Angleangle angleangleaew said...

There are many kinds of products in Our store, and we have MBT shoes such as shoes online,scarpe mbt. Converse with leisure cloth shoes such as all star converse,converses all star,
all star converse. With burberry, all kinds of products such as burberry uk.There we go out and play casual hat such as cappelli new era, cap new era.Welcome to our shop the choose and buy.

shorry june said...

Hey there! This is our first stop by at your website!We are an
cheapest android phones amount of volunteers as well as starting

shorry june said...

My partner and i on a regular basis e mailed this amazing site ibaikal post site to all or any my associates, given that if prefer to readit following my personal backlinks can way too.

shorry june said...

this post. I will apt to be coming back to the websitefor cheap android phone further shortly.Piece of content will be taken to share,

nongfu380 said...

I. Require. To. Buy. This.Amazing, you might be remarkable! I like everything about it.costume cosplay vampire knight
I love all of your have missed internet connections much :) Continue the fantastic function!I like the polka dept of transportation environment. :)

AntoL-Nyo said...

Ben istanbuldan selda 22 yaşında konfeksiyon içşisiyim Amatör Porno sizleri bekletmeden hemen hikayeme geçiyorum.. Biz 5 katlı bir binanın en üst katında yaşıyorduk ve bir öğlen paydosunda sevgilim beni Anal Sikiş aradı evdeydim çünkü evle iş yerim arasında 2 dakika bile yoktu.. Bende Asyalı Porno sevgilime benden telefon beklemesini söyledikten sonra evin durumuna baktım evde kardeşlerim ve annemin Esmer Porno birkaçtane arkadaşı vardı bu iş imkansızdı tekrardan düşündüm ve çatı katı aklıma geldi sevgilime telefon açıp çatıya çıkmasını ve Fantazi Porno beni beklemesini söyledikten sonra telefonu bir süre elime almadım anneme işe gidiyorum dedikten sonra Gay Porno hemen üst kata çatıya çıkıp sevgilimin
dudaklarına yumuldum az bir süremiz Götten Sikiş vardı ve çok istiyordum onu hemen önünde diz çöküp sikini çıkardım kocaman olmuştu bile... Özlemişti beni HD Porno bitanem başladım sikini yalamaya kafasını öpüyor onu çıldırtıyordum sevgilim saçlarımdan tutmuş ağzımı keyifle sikerken çatı katının kapısı açıldı toparlanamadan Lezbiyen Porno komşunun şişman oğlu efecan gelmişti ben dizlerimin üzerinde sevgilimin Liseli Porno siki ağzımda yakalanmıştım hemen bu halimizi gören komşu oğlu Sarışın Sikiş kaçarcasına gitti.. Sevgilim bir süre güldükten Türbanlı Porno sonra bu şişko neden kaçtı korktu herhalde onu sikicem sandı galiba dedikten sonra bir kahkaha daha attı ben sevgilimin Türk Porno sikine deli gibi saldırıyor yalıyor emiyordum boşalmasını istiyor Zenci Porno sütünü içmek istiyordum sevgilim ağzımı sike sike boşaldı hepsini yuttum bir damlasını ziyan Porno etmedim ve sevgilimle vedalaşıp ayrıldık... Ben her defasında sikiş yapmadan önce yazporno diye olan türkçe siteden Porno izle bölümüne girip seyrediyorum azdıktan sonra şahane sikiş ile gözleri kamaştırıyorum.

Amanda kennedy said...

This blog is really fantastic and informative for me
project management training