Thursday, March 30, 2006

Ruby LoadError, Quick fix

Ruby library load error, takes long time for a newbie but simple hack could get you up and running with your thing.
I just installed RubyFul_Soup[ Ruby port of the hit Python HTML/XML parser Beautiful Soup.] and wanted get started with RadRails , so when I write this line on top

require 'RubyFulSoup' as per the example given I get following error

LoadError: No such file to load -- rubyfulsoup

The thing is when you install any gem using "gem install" , it installs gem under /usr/lib/ruby/gems/1.8/gems , so somehow ruby does not really get where to pick up gems from , best thing to do a quick sanity check regarding your setup , and you can do that by "irb" (Interactive Ruby Shell), just type
bash> irb
irb(main):002:0> require 'RubyFulSoup'
LoadError: No such file to load -- RubyFulSoup
from (irb):2:in `require'
from (irb):2

basically gem installed is "rubyful_soup' and its under /usr/lib/ruby/gems/1.8/gems
and Ruby looks for files under /usr/lib/ruby/1.8/ , So all I did is copied rubyful_soup.rb file from /usr/lib/ruby/gems/1.8/gems to /usr/lib/ruby/1.8/ and also copy htmltools gem files to /usr/lib/ruby/1.8/, then run

irb(main):001:0> require 'rubyful_soup'
=> true

This is a quick fix till I figure out the real solution for this

Wednesday, March 22, 2006

RadRails puts RoR on Web2.0 development Autobahn

It took me less than 50% time to get a small database RWD (Read-Write-Delete) application in RoR (Ruby On Rails) as compared to traditional Java application on Eclipse. How I did that, using RadRails
What is RadRails, Its a bomb!, its amazing, seriously I was never this excited, when Eclipse happened to Java/J2EE world. Why because it took me more time get Eclipse up and running with my java project and hook tomcat to it , yadda yadda!. But I could count it on on my fingers how long it took me get one simple rails app up and running with built in WEBrick server. It was just less than 5 mins, I had simple customer application with DB read/write/delete running on my browser.
RadRails is written on Eclipse framework, but extremely sexy, in terms producing components. Like rails/ruby/database/subversion support etc.

Some of the cool features
  • mvc key bindings : To jump one context of development to another, moving between view (.rhtml ) to app controller faster.
  • Generate tabs: All rails generate command on your fingertips
  • Console/Tail : Very helpful in AJAX development where you can see data going back and forth between your client and server.

Oh yeah!, did I say how It was this quick , have a look at the screencast , you got to love this stuff!!..

There is a famous say "You need a reason to convince yourself, why you should do different deed", I guess RadRails is my reason to love Ruby/RoR.

So finally I would say "Got RoR!"