Ruby on Snow Leopard
As you all know, Apple released the Snow Leopard. With the promises of smaller footprint, performance boost, and better 64-bit meant the upgrade is a mandatory for me. Naturally, I upgraded to Snow Leopard and at the same time, upgraded my Macbook Pro. Apple is including Snow Leopard disk along with the new computers and despite what they say on the net, you CAN do the clean install.
I installed 64-bit version MySQL straight from the package version. I recommend just downloading from mysql.com rather than dicking around with Fink or Macport. I just don’t see the need. Besides, the only reason why I have MySQL is all my projects haven’t moved to Postgres. I just copied the data directory from the old MBP and everything works without any hiccups.
Snow Leopard comes with Ruby 1.8.7. This is a problem for me since I haven’t had a good experience with this particular version. My projects aren’t the latest version of Rails. Couple of my projects are loaded with plugins (I’ll talk about my hatred towards plugins some other time) that break on version 1.8.7. So, what does a Rubyhead do?
Install Ruby 1.8.6 by compiling from the source, but do not overwrite the existing Ruby. Here’s a summary of what I did.
1) I changed the added following line to /etc/profile so that /opt directory is the first directory before other directories.
export PATH=/opt/bin:/opt/sbin:/usr/local/mysql/bin:$PATH
2) Downloaded latest Ruby 1.8.6 from ftp://ftp.ruby-lang.org/pub/ruby/1.8
3) I found it really interesting that I can compile from source without too much hassle.
./configure --prefix=/opt --enable-pthread --enable-shared CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install
4) As always, I went into {ruby source directory}/ext and checked individual extensions.. The best thing is that I didn’t have to download anything.
ruby extconf.rb
make clean
sudo make install
5) I then downloaded Rubygems and installed it. Why? Because I wanted the original gems intact.
ruby setup.rb --prefix=/opt
6) Now that I have both Ruby and Rubygems installed, just do “sudo gems install” all your gems. You’re good to go. The only thing that I did differently was for MySQL. I wanted to make sure any extensions are 64-bit.
sudo env ARCHFLAGS="-arch x86_64" gem install mysql
Notice that I didn’t have to do “–mysql-config=”. Nice!
That’s all! Now I’m running with Ruby 1.8.6.
Hey, what about Ruby Enterprise Edition?
The make failed for me and I really didn’t want to find out since this is my development machine. Besides, I was just too damn tired.
Hope this helps. I’ll start doing some screencasts as soon as I’m up and running on the new machine.
Scrum Tools List
The guys at userstories.com put together a comprehensive list of free and commercial scrum tools. Well worth it if you’re doing any kind of agile development.
why’s Poignant Guide to Ruby
Now that _why has disappeared and took down everything, the access to WPGTR may be hindered for others. You can download the PDF version from my server. Here’s the link. Just right click on your mouse and save or any other method you may have to.
What to Expect in Rails 3.0
Yehuda Katz presents “What to Expect in Rails 3.0″. This is O’Reilly Webcast. It’s probably better to go to the YouTube site and watch it in HD.
Peepcode on Safari Bookshelf
I was pleasantly surprised when I saw that Peepcode screencast showed up in What’s New email from O’Reilly’s Safari Bookshelf. Granted there are only 9 episodes at this time, but they’re the most recent ones.
I highly recommend Safari since I won’t go broke buying books and with this addition, it makes the life little more interesting.
Rack’s env
Ever wonder what the “env” looked like in Rack? Run this code via Ruby and point your browser to http://localhost:4000 to find out.
class SuperMicroApp
def call(env)
[200, {'Content-Type' => 'text/html'}, pretty_env(env) ]
end
def pretty_env(hash)
pretty_hash = ""
hash.each do |k,v|
pretty_hash += "#{k}: #{v} --> #{v.class}<br />"
end
pretty_hash += "<br /><br />"
hash["REQUEST_PATH"].split("/").each do |r|
pretty_hash += "#{r=="" ? "none" : r}<br />"
end
return pretty_hash
end
end
require 'rubygems'
require 'rack'
Rack::Handler::Thin.run(SuperMicroApp.new, :Port => 4000)
Software Architecture Documentation
If you’re a software architect, or think you are one, please click here. The deliverable of a software architect is the documentations to communicate the architecture and providing a blueprint for the coders to build.
I’m always shocked that kids these days get titles that really doesn’t reflect what they do or even qualified to do. Hmm, perhaps I should give myself the CEO title…
Introduction to Cappuccino
Remember Cappuccino? Here’s the link to the presentation made by Francisco Tomalsky at Future Ruby Conference.
http://www.infoq.com/presentations/tomalsky-cappuccino
Burst.net Day 1
I’m somewhat shocked that even though it’s a weekend, Burst.net got my server up and running within 24 hours. Very nice!
I logged onto the machine and it’s a minimal Ubuntu 8.04 64-bit server, just as I ordered. I really liked the fact that they didn’t install anything and it’s a clean machine for me to configure, the way I like it. I quickly installed Apache, Postgres, Ruby, Passenger, and REE (Ruby Enterprise Edition). The network is really fast and the machine is just incredible. With 1TB, I now use this server to serve up my Git repositories.
I verified the processor and the memory. I just can’t believe that I now have enough processing power along with the memory to make my apps really shine, all at a price of a VPS!
It’s a good start, and we’ll see what happens next few weeks.
Forget VPS for App Deployment
I switched over from a dedicated server to VPS few years ago in order to save some cash. I’ve happy until I realized that I have to pay more as VPS just can’t handle the load. I was somewhat shocked by how little load is required before VPS comes crashing down.
Rather than getting more expensive VPS, I just found a dedicated server hosting for basically the price of VPS. Click here to go to the site and make sure you click on Summer 2009 Sale. They’re currently running a sale where you can get a dedicated server outfitted with Quad Core2 2.5Ghz with 8GB RAM, 1TB disk, and 4000GB of monthly bandwidth for, get this, $99.95 per month!
I jumped on the deal and will write a follow-up post after playing with the server.