Monday, June 16, 2008

Ruby Conference in Northern Virginia

RubyNation
RubyNation is an annual Ruby conference serving the Virginia, West Virginia, Maryland, and Washington, DC areas. This year's RubyNation will happen on August 1 & 2, 2008 in Herndon, VA. Please visit the RubyNation site for more details.

Friday, September 21, 2007

Railing on JBoss

I recently successfully deployed a Ruby on Rails app running on jruby that uses ActiveRecord-JDBC adapter to talk to Oracle 10g database to run on JBoss 4.2.1. I used warbler plugin from Nick Seiger to convert the rails app to war file. I basically followed the instructions at this article about warbler (http://blog.nicksieger.com/articles/2007/09/04/warbler-a-little-birdie-to-introduce-your-rails-app-to-java) and this one on using warbler with JBoss http://www.advogato.org/person/johnnyb/. Warbler makes it very easy to convert a rails app into a war file.


There were a few quirks during this process which are listed below and hopefully these will be helpful to those trying to do the same. Theoretically this should work on any J2EE compliant app server or even Servlet containers.

  • I had to uncomment the following line in warble.rb (warbler config file)
#config.gems = ["ActiveRecord-JDBC", "jruby-openssl"]


and change it to


config.gems = ["rails", "ActiveRecord-JDBC"]


This packages rails and ActiveRecord-JDBC gems in the war file.
  • To use ActiveRecord-JDBC adapter you need to add the following code to environment.rb file

if RUBY_PLATFORM =~ /java/

require 'rubygems'

gem 'ActiveRecord-JDBC

require 'jdbc_adapter'

end

You need to be careful about where in that file you add these lines. They must be added before the line


Rails::Initializer.run do |config|

  • This one should be obvious but you need to add the jdbc driver jar to JBoss lib folder. Since I used the default configuration in Jboss I added it to C:\opt\jboss-4.2.1.GA\server\default\lib folder.

Thursday, June 21, 2007

Accessing MySql from remote machine in my network

Just got my Ubuntu box up and running with Fiesty Fawn and installed MySQL server (5.x). The default server does not allow, the MySQL server to be accessed remotely. Besides adding the user to user's table in MySQL database, I had to additionally edit my.cnf file in /etc/mysql and change the following setting:

from
bind-address = 127.0.0.1

to

bind-address = 0.0.0.0

The IP of 0.0.0.0 allows incoming connection from any host and of course you need to make sure there is not firewall in between blocking the port 3306. Since all this setup sits behind my Linux firewall it is pretty secure and allows me to develop my ROR apps from the windows box by accessing MySQL databases on another machine.

Saturday, February 10, 2007

Ruby and Rails Cheat Sheets

It is hard to remember all the useful Ruby and Rails utilities that one uses on a regular basis. But then you don't have to, there are some very commonly used Ruby and Rails related cheat sheets here and more can be easily added and shared.

Thursday, October 26, 2006

Rails Plugins Presentation

Yesterday at our local Northern Virginia Ruby User group meeting I gave a presentation on Rails Plugins. The presentation can be accessed here. In this presentation I discuss some general info about Rails plugins followed by the installation, configuration and usage of four useful plugins tabnav, acts_as_authenticated, file_column and acts_as_state_machine.

Saturday, September 02, 2006

Upgrade Engines to work with Rails 1.1.6

My Rails app at www.saraibooking.com just broke as Textdrive have upgraded Rails to 1.1.6 and the version of Engines, Log Engine and User Engine I had was not compatible with Rails 1.1.6. I removed the folder engines, login_engine and user_engine under RAILS_ROOT/vendor/plugins and installed engines, login_engine and user_engine using script/plugin, restarted rails and everything was nice and dandy again. Using engines with Rails is slightly risky in this regard as almost every new version of Rails seems to break them. DHH did not had any good words to say about Engines at RailsConf in Chicago.

Thursday, August 17, 2006

Tabs in Ruby on Rails

I am starting to prepare for a presentation for my local Ruby users group Novarug and the topic is cool Ruby on Rails plugins. In this presentation I will demoing some very useful plugins and in this quest I found a very nifty plugin that provides tabs functionality to RoR applications. It is so easy to setup (isn't that true for all ROR plugins) and in minutes I had the tab functionality added to my RoR application. Check it out here.

Friday, April 15, 2005

Trying openbox on gentoo

Since Gnome is pretty resource intensive desktop environment, I decided to install openbox Widows Manager on my latest gentoo installation. It is certainly very fast to get loaded but there is not much to see. Of course I had to use right click of mouse to see the menu's. Also tried pypanel which is supposed to help create panels in openbox but still trying to figure out how. If anybody has used pypanel drop me an email to give me some pointers.