JRuby App Demo

Although this screencast is somewhat dated, it demonstrates creating a JRuby on Rails app using NetBeans. It’s also a good demonstration of NetBeans for those still searching for an IDE in Linux environment. Click on the image to view.

Click to view video

Ubuntu 8.10 Released

Now that Ubuntu 8.10 has been released, I’ll start playing with it to see if I need to make any modifications to ever-popular http://www.rubyhead.com/2008/04/25/installing-ruby-rails-on-ubuntu-804-hardy-heron/ post. It looks like it will take quite some time before it finishes downloading… I can’t imagine the amount of traffic Ubuntu servers are receiving…

In any case, I really don’t feel compelled to upgrade my workstation since this is not LTS (the support expires in 2010, before Hardy Heron) like Hardy Heron (8.04). Besides, my devices work well, including Sprint U720 USB EVDO card with Heron.

JRuby Part II - Initial Observations

After two weeks of playing with JRuby, here’s a short list of things I found:

1- Everything takes longer to load due to Java, but once loaded, it flies compared to MRI.
2- Libxml doesn’t work, but you can use Java’s xml library without any problem. Yes, it’s still faster than ReXML. If you want compatibility with MRI, use Hpricot. I don’t think the sacrifice in performance is that significant depending on your uses.
3- Use “require unless RUBY_PLATFORM =~ /java/” if you want to make Ruby exchangeable in your app. I’ll go into details later about this topic.
4- Hpricot doesn’t load unless I write “require ‘rubygems’”. By the way, it goes for just about every gem I installed. Requiring rubygems seems to be needed for just about everything. This is the case for both Mac and Linux.

I’m really excited by what I’ve seen so far, but I’m just scratching the surface. My next experiment will be creating a simple Rails app and deploy on both MRI and JRuby and see what needs to be adjusted.

No, There’s No Cross-Browser Issue, It’s Damn IE Issue!

I’m so sick and tired of Internet Explorer! CSS and JavaScript always work the way I envision in every browser except the Microsoft Internet Explorer. I’m always writing hacks and work-arounds for IE, not anything else. This is why I laugh when people say a “cross-browser problem” when in reality, it’s really a “IE problem”.

Looking at the log of this site, I’m really happy that IE is used by just a small percentage of users. It’s rather obvious due to the intended audience of this blog. So I ask everyone here, friends should never let other friends use IE!

JRuby Part I - Installing JRuby

*** Updated ***

I’m working on re-architecting a RoR app and wanted to check out JRuby rather than sticking with MRI. Here’s what I did to install it on my MacBook Pro running Leopard.

1. Download JRuby at http://dist.codehaus.org/jruby/jruby-bin-1.1.4.zip
2. Unzip the file to /opt
sudo unzip jruby-bin-1.1.4.zip /opt/
3. Create a symlink to JRuby so that I don’t have to type in the version number.
sudo ln -s /opt/jruby-bin-1.1.4 /opt/jruby

For Ubuntu 8.10LTS Hardy Heron, please enter following command to facilitate /usr/bin/env jruby.
sudo ln -s /opt/jruby/bin/jruby /usr/bin/jruby
4. Add the following line to /etc/profile
export $PATH:/opt/jruby/bin

5. Add following alias to make my life easier.
alias jr='jruby -S'
alias jss='jruby -S script/server'
alias jsgen='jruby -S script/generate'
alias jscon='jruby -S script/console'

6. Install absolute bare essential gems.
sudo jruby -S gem install jruby-openssl rails mongrel jdbc-mysql activerecord-jdbcmysql-adapter activerecord-jdbcsqlite3-adapter jdbc-sqlite3 hpricot

I did basically the same thing on my Ubuntu and it works just fine this way. If you want and you’re really brave, you can replace the symlink for ruby in /usr/local/bin with jruby to completely replace MRI.

I found that Rails works well except for the fact that libxml isn’t available with JRuby due to the fact that anything with C extensions will not work. Another thing that I have to remember that in database.yml of a Rails app, the adapter must have jdbc before the name. e.g. adapter: sqlite3 => adapter: jdbcsqlite3. If you run script/generate without jruby -S, you’ll get an error if your adapter is now using jdbc.

I’ll post my experience with JRuby in upcoming posts. After I’m done with JRuby, I’ll be moving to YARV, and Rubinius last since I’ve been playing with Rubinius for awhile.

Back to Vim Again

In my never ending pursuit of finding a good text editor on Linux, I tried my best to convert to emacs. I bought the book, saw screencasts, and listened to evangelists. Needless to say, I failed, and came back to the editor I always come back to, Vim.

I love Geany and tried to use it, but my old habits from using Vim makes using a GUI editor somewhat annoying, especially with limited set of features. Netbeans is great but it doesn’t have word wrap feature. What gives?

So, now I’m back to Vim, again. This time around, I decided to make things little prettier with my own syntax highlighting, but I feel like an addict keep falling off the wagon. Who knows, perhaps Vim is a drug.

If you’re starting out and want to find out how it can be used, check out introduction by Justin Lilly at http://justinlilly.com/category/server-admin/vim-server-admin/ where he has a great set of screencasts.

Voices That Matter Professional Ruby Conference

I will be attending Voices That Matter Professional Ruby Conference in Boston and look forward to meeting other RubyHeads. If anyone’s interested, shoot me an email (joon at this domain) and I will show the video of my tutoring sessions I promised before (haven’t had the time to edit). It will be in its rough mostly unedited format (I’m just removing any private information Ben and I discuss), but I think it would be valuable.

I am pleased to let you guys know that the organizers of the conference provided me with a promotional code for $200 off. In addition, if you register by Oct 13th, you get additional $200 off, giving you $400 off total for the conference. The code is PR2MAL4 and must be entered at the time of registration. The conference website is http://www.voicesthatmatter.com/ruby2008 and it’s held in Boston from November 17 - 20.

The pre-conference workshops include both introduction and advanced Ruby tutorials including one from Hal Fulton (author of The Ruby Way). These workshops should serve specially well to those currently not using Ruby and want to find out more. However, looking at the outlines, it appears that experienced developers will find something new as well.

The sessions includes real world case study from New York Times and Yellowpages.com. The best part of this conference is that it’s not just about Rails. It covers Mongrel, Ruby and Java VM.

« Previous PageNext Page »