Manish Chakravarty's Blog

Thoughts. Musings. Suggestions, Ramblings


Previous Entry Add to Memories Share Next Entry
Setting up a JRuby on Rails 3 + NetBeans dev environment
manish_chaks
Aim: to get a dev environment up and running for what would be a mixed-mode Java/JRuby project using NetBeans as the IDE.
If NetBeans is your IDE of you choice then this blog post should help you out.
I have done these steps using a macbook pro / OSX Leopard with NetBeans 6.9 - steps should be pretty much the same on other platforms.

==========

Download JRuby from here and extract it in a directory of your choice ( I used /Users/manish/Desktop/jruby-1.5.2 for this example )

Fire up neatbeans
Go to Project - > New Ruby on Rails project.

We will now attempt to point NetBeans to the latest version of JRuby that we downloaded.

Click on the "Manage" button
New Ruby on Rails application - manage the ruby platform

In the Ruby Platform Manager, browse and point to the "jruby" binary in the "bin" folder :

We will now attempt to setup the ruby-debugger.
Download the jruby-debug-base gem from here and save it.
Install the gem locally.
Here's the command-line trace
% ./jruby -S gem install -l ~/Desktop/ruby-debug-base-0.10.3.1-java.gem
Successfully installed ruby-debug-base-0.10.3.1-java
1 gem installed
Installing ri documentation for ruby-debug-base-0.10.3.1-java...
Couldn't find file to include: 'VERSION'
Installing RDoc documentation for ruby-debug-base-0.10.3.1-java...
Couldn't find file to include: 'VERSION'


Now pull in the ruby-debug-ide gem

Here's the command-line trace
% ./jruby -S gem install --ignore-dependencies -v 0.4.6 ruby-debug-ide
Successfully installed ruby-debug-ide-0.4.6
1 gem installed
Installing ri documentation for ruby-debug-ide-0.4.6...
Installing RDoc documentation for ruby-debug-ide-0.4.6...


Switching back to netbeans, give your project and name and choose the correct platform as shown below:

Choose the correct target platform

Configure the DB - I would strongly suggest using SQLite or MySQL unless your team has a good reason to use a different database. In the example I have used derby but I do not recommend it.


We now go to the installing rails page:
We have three action items - I have marked them with blue arrows


Click on the "Install Rails button" - you get the following dialog once it gets done:
Rails installation done

After this I also installed Warbler and JRuby openssl.
Hit next and let netbeans complete the project creation.

Now that we have a JRuby on Rails 3 project created on the site, lets find out how to debug this application inside of netbeans.

Firing up the debugger ( Command-F5 ) - Netbeans tells me that it's downloading the glassfish debug gem - I am not sure why this is there - but I let it go ahead nonetheless.


Turns out I was wrong - I changed the server preferences to webrick.
Right click on the project name in the left pane , select "properties" and select Webrick server from the drop down as show below:
Change netbeans server preferences to Webrick


You would also need to comment out the entry referencing the sqlite-ruby gem in the Gemfile ( Line #8 ) as show below:
Comment out the need for sqlite3-ruby in the gemfile

We now need the activerecord-jdbcsqlite3-adapter ( we commented out sqlite in the previous step )

The command line trace on my system is as follows:

% ./jruby -S gem install activerecord-jdbcsqlite3-adapter
Successfully installed jdbc-sqlite3-3.6.3.054
Successfully installed activerecord-jdbcsqlite3-adapter-0.9.7-java
2 gems installed
Installing ri documentation for jdbc-sqlite3-3.6.3.054...
Installing ri documentation for activerecord-jdbcsqlite3-adapter-0.9.7-java...
Installing RDoc documentation for jdbc-sqlite3-3.6.3.054...
Installing RDoc documentation for activerecord-jdbcsqlite3-adapter-0.9.7-java...



Hit F6 to run your app and voila!

Safari running JRuby on Rails 3

==========

Further reading:
1. JRuby Debugging
2. JRuby and Rails 3 ( This information in this link is a bit outdated though )

... so much about NetBeans. Nice to know there's more of us to go around! ;)

одноклассники секс знакомства

(Anonymous)

2011-01-08 11:22 pm (UTC)

http://vkontakte.ru/id118357807
клуб знакомств в иваново
http www znakomstva ru
бесплатные секс знакомства в ульяновске (http://vkontakte.ru/id118346125)
[url=http://vkontakte.ru/id118388542]клуб знакомств феличита[/url]

exahxhmm exqo

(Anonymous)

2011-01-09 07:00 am (UTC)

rrattoz yrc qzzse 3some porn (http://www.threesomeporn234.com/3some porn.html)

ejizi!

rveky xdeyzu xyl mature young (http://www.matureporn234.com/mature young.html)

david jones torebki

(Anonymous)

2011-01-12 02:35 am (UTC)

torebki damskie (http://torebki4you.com)
to kazar , torebki damskie w³oskie , torebki . torby skórzane , torebki damskie ?

unlock iphone 3gs

(Anonymous)

2011-01-13 12:26 pm (UTC)

how to unlock iphone 3gs (http://UNLOCKIPHONE3GS4.INFO)
to unlock iphone 3gs , iphone 3gs unlock , . iphone 3gs unlock , ?

unlock iphone 3g

(Anonymous)

2011-01-13 01:22 pm (UTC)

unlock iphone 3g (http://UNLOCKIPHONE3G4.INFO)
to how to unlock iphone 3g , how to unlock iphone 3g , . iphone 3g unlock , ?

unlock iphone 4

(Anonymous)

2011-01-13 03:04 pm (UTC)

how to unlock iphone 4 (http://e-unlockiphone4.com)
to unlock iphone 4 , how to unlock iphone 4 , . unlock iphone 4 , ?

satellite tv for pc

(Anonymous)

2011-01-13 05:57 pm (UTC)

satellite tv for pc (http://easysatellitetvforpc.com)
to satellite tv for pc , satellite tv for pc , . satellite tv for pc , ?

buy facebook fans

(Anonymous)

2011-01-13 07:17 pm (UTC)

get facebook likes (http://1000FACEBOOKFANS.INFO)
to buy facebook likes , buy facebook fans , . get facebook fans , ?

Rhothling

(Anonymous)

2011-01-15 11:10 pm (UTC)

david jones (http://torebki4you.com)
to torebki damskie , torebki david jones , . torebki david jones , ?

Robethric

(Anonymous)

2011-01-16 01:00 am (UTC)

unlock iphone 4 (http://UNLOCKIPHONE44.INFO)
to iphone 4 unlock , how to unlock iphone 4 , . how to unlock iphone 4 , ?

Rouldwick

(Anonymous)

2011-01-16 01:56 am (UTC)

iphone 4 unlock (http://UNLOCKIPHONE43.INFO)
to unlock iphone 4 , how to unlock iphone 4 , . unlock iphone 4 , ?

Saevindis

(Anonymous)

2011-01-16 03:49 am (UTC)

how to unlock iphone 4 (http://UNLOCKIPHONE4-4.INFO)
to unlock iphone 4 , how to unlock iphone 4 , . how to unlock iphone 4 , ?

Santourel

(Anonymous)

2011-01-16 06:41 am (UTC)

unlock iphone 4 (http://unlockiphone44.com)
to iphone 4 unlock , how to unlock iphone 4 , . how to unlock iphone 4 , ?

Sathrodor

(Anonymous)

2011-01-16 08:38 am (UTC)

iphone 4 unlock (http://e-unlockiphone4.com)
to iphone 4 unlock , unlock iphone 4 , . how to unlock iphone 4 , ?

Sveivenod

(Anonymous)

2011-01-16 08:20 pm (UTC)

get facebook likes (http://1000FACEBOOKFANS.INFO)
to buy facebook likes , buy facebook fan , . get facebook likes , ?

Taladrieg

(Anonymous)

2011-01-16 11:08 pm (UTC)

projektant wnetrz bialystok (http://vader-wnetrza.pl)
to projektant wnetrz , projektant wnetrz bialystok , . projektant wnetrz , ?

Talexande

(Anonymous)

2011-01-17 12:06 am (UTC)

write ebooks (http://WRITING-EBOOKS-FAST.INFO)
to write ebooks , write books , . write books , ?

Tefordies

(Anonymous)

2011-01-17 02:02 am (UTC)

work at home (http://WORKATHOMEBIZ123.INFO)
to work at home , work at home , . work at home , ?

Teniffydd

(Anonymous)

2011-01-17 03:59 am (UTC)

warcraft leveling guide (http://WARCRAFT-LEVELING-GUIDE.INFO)
to warcraft guide , warcraft guide , . warcraft leveling guide , ?

Thamworth

(Anonymous)

2011-01-17 06:58 am (UTC)

how to unlock iphone 4 (http://UNLOCKIPHONE44.INFO)
to iphone 4 unlock , unlock iphone 4 , . unlock iphone 4 , ?

Thianaiau

(Anonymous)

2011-01-17 10:03 am (UTC)

unlock iphone 4 (http://UNLOCKIPHONE4-4.INFO)
to unlock iphone 4 , iphone 4 unlock , . iphone 4 unlock , ?

Tinchayde

(Anonymous)

2011-01-17 01:11 pm (UTC)

twenty cricket (http://TWENTY-CRICKET-GUIDE.INFO)
to twenty cricket guide , twenty cricket guide , . twenty cricket guide , ?

Toirbeleb

(Anonymous)

2011-01-17 02:15 pm (UTC)

website traffic (http://TRAFFICTOWEBSITE123.INFO)
to website traffic , website traffic , . website visitors , ?

Tralduret

(Anonymous)

2011-01-17 03:20 pm (UTC)

irritable bowel syndrome (http://TREATIRRITABLEBOWELSYNDROME.INFO)
to treat bowel syndrome , treat irs , . treat bowel syndrome , ?

Trehtwulf

(Anonymous)

2011-01-17 04:22 pm (UTC)

trout fishing (http://TROUTFISHING123.INFO)
to trout fishing , trout fishing , . trout fishing , ?

Glanuccer

(Anonymous)

2011-01-18 12:29 am (UTC)

parenting (http://SINGLEPARENTING-GUIDE.INFO)
to single parenting guide , single parenting guide , . parenting , ?

Gouerthak

(Anonymous)

2011-01-18 07:02 am (UTC)

keyword research (http://PROFITABLE-KEYWORDS1.INFO)
to keyword research , profitable keywords , . keyword research , ?

Greeannur

(Anonymous)

2011-01-18 10:19 am (UTC)

productivity improvement (http://PRODUCTIVITY-IMPROVEMENT.INFO)
to productivity improvement , productivity improvement , . improve productivity , ?

Grimanner

(Anonymous)

2011-01-18 03:12 pm (UTC)

sell articles (http://SELLARTICLES.INFO)
to sell articles , sell articles , . sell articles , ?

Gundlewis

(Anonymous)

2011-01-18 06:35 pm (UTC)

how to raise goats (http://RAISINGGOATS123.INFO)
to how to raise goats , raise goats , . raise goats , ?

Gwenthiel

(Anonymous)

2011-01-18 08:43 pm (UTC)

quit smoking guide (http://QUITSMOKING-GUIDE.INFO)
to quit smoking guide , quit smoking , . quit smoking , ?

Helfweald

(Anonymous)

2011-01-19 04:48 am (UTC)

mind control (http://MINDCONTROL123.INFO)
to mind control , mind control , . mind control , ?

Herardosh

(Anonymous)

2011-01-19 06:29 am (UTC)

metal detecting (http://METALDETECTINGEASY.INFO)
to metal detecting , metal detecting , . metal detecting , ?

Holmarion

(Anonymous)

2011-01-19 09:50 am (UTC)

marketing (http://MARKETING-ADVICE22.INFO)
to marketing , online marketing advice , . marketing , ?

Hubercild

(Anonymous)

2011-01-19 01:08 pm (UTC)

muscle building (http://MUSCLEBUILDINGINFERNO101.INFO)
to muscle building , muscle building , . muscle building , ?

Imlothidh

(Anonymous)

2011-01-19 09:34 pm (UTC)

list building (http://LIST-BUILDING-SECRETS1.INFO)
to mail list , email list , . mail list , ?

You are viewing manish_chaks