Ruby & Rails using Passenger

Monday, July 28th, 2008

I have been toying with a MySQL server at work for loading data from a legacy database and creating user accounts in Microsoft’s Active Directory. I am using linux along with MySQL, Ruby and the Rails framework. While I am certainly no über-expert at this, I am finding the task not only manageable, but altogether pleasant. My current workflow looks like this:

  1. Mount Windows share using Samba
  2. Load data into MySQL and perform a bunch of transformations on it
  3. TODO: script creation of Active Directory accounts from MySQL Database (Python??)

I found that I needed to view the data as I was testing the MySQL transformations, so I turned to Ruby and Rails. I have not had a great deal of luck in the past with configuring Apache to serve up dynamic content via Mongrel or lighty, so I decided to give Passenger a go. For those of you that are unaware, Passenger works directly with Apache and requires almost no configuration. It is dead simple to use. So, within a matter of minutes (minus the time to tweak my database to conform to the Rails conventions) I had a web site up and running to display my data as I was testing it!

Open Source Software is becoming (for me at least) a more viable solution to the problems I face than the proprietary alternatives. The wealth of information available and the relative ease with which a great deal of work can be done is amazing.

Debian + Ruby + Gem + Rails + Mongrel = RubyOnRails

Wednesday, March 21st, 2007

After much frustration, I think I finally have a working installation recipe for RubyOnRails on Debian Linux.

  1. Install Debian
  2. Install ssh and sudo
  3. apt-get install ssh sudo

  4. Remove “root” login from ssh config file
  5. Create a “source” directory
  6. cd /
    mkdir source

  7. Install tools for compiling from various sources
  8. apt-get install gcc gcc-3.4-doc gcc-3.4 g++-3.4 make libc6-dev flex openssl curl wget zlib1g-dev libzlib-ruby

  9. Download latest Ruby (1.8.5 as of this entry), unpack and install
  10. cd /source
    wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.5-p2.tar.gz
    tar xzvf ruby-1.8.5-p2.tar.gz
    cd ruby-1.8.5
    ./configure
    make
    make install
    cd ..

  11. Download, unpack, compile and install zlib (not included in testing version of Ruby?)
  12. wget http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
    tar xzvf ruby-zlib-0.6.0.tar.gz
    cd ruby-zlib-0.6.0
    ruby extconf.rb
    make
    make install
    cd ..

  13. Download, unpack, compile and install Ruby Gems (0.9.2 as of this entry)
  14. cd /source/
    wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz
    tar xzvf rubygems-0.9.2.tgz
    cd rubygems-0.9.2
    ruby setup.rb

  15. Install Rails
  16. gem install rails --include-dependencies

  17. Install Mongrel
  18. gem install mongrel mongrel_cluster --include-dependencies

  19. Create a dummy application
  20. cd ~/
    rails test
    mongrel_rails start

  21. Go to http://your.ip.address:3000/ to see if it works
  22. Sources

Linux

Wednesday, March 7th, 2007

It may just be me, but it seems as though Linux has been in the news with increasing frequency. It seems like a giant snowball is beginning to form and may have the potential to be a serious game changer. With the upgrade to Vista looming in a dark corner for most organizations, it seems like once passed over alternatives are looking considerably more viable. As one who works in the IT industry, I am all for it! While I don’t dislike Microsoft’s Windows XP operating system, it is definitely lacking. The next version of Microsoft’s operating system, entitled Vista does offer some new features, but it is a fear of the unknown security flaws that makes me less than enthusiastic about it. Being a complete Linux noob, I have quite a few questions and concerns, most of them concerning integrating Linux into our existing server environment. I am sure that these questions all have answers, I just don’t know them yet!

My first post from a Linux machine

Wednesday, June 28th, 2006

So, I installed Ubuntu Linux on a laptop and I am posting to my very own weblog from Firefox which is running in Ubuntu Linux. I have to admit that the installation was seemless, and the GUI looks very nice. I am definitely intrigued!