- O’Reilly Media for over $500 of book sponsorships that we’ll continue to distribute to the group for review at future events. If you want to see more awesome O’Reilly stuff, post a review with your thoughts of the book to Amazon, Slashdot, or your blog. (No, twitter doesn’t count… *stares at Sunny accusingly*.)
- JumpBox for graciously covering the tab for the entire group and congratulations on your continued success!
- All y’all geeky food addicts for showing the love.
The Official OpenRain Blog
Noon, Pacific Seafood Buffet. Bring $10 for all-you-can-eat sushi and other great buffet eats. (There’s much more than seafood, and veggie stuff too.) Table reserved under “Lee”. Give-a-ways provided by O’Reilly Media…
- High Performance MySQL
- Understanding MySQL Internals
- iPhone: The Missing Manual (2nd ed., covers the iPhone 3G)
Map: http://tinyurl.com/5f5jfj
Venue: http://www.pacificseafoodbuffet.net/
Sit Next To: Someone you don’t know!
OpenRain is a U.S. company with U.S. staff. The value of direct, barrier-free, native-language communication outweighs any perceived cost savings of outsourcing our niche, not to mention it’s a lot more fun to work in the same office and time zone. For a typical 3-month project with 2 developers, it’s not uncommon in an outsourced environment to need a full-time project manager on both client and developer sides just to manage tasks, meetings, legal, logistical issues etc.; an unnecessary cost which alone has increased the bill 50%. By keeping operations local, we’re able to remain far more agile in a far lighter development environment.
Nevertheless, we periodically talk to a potential client who is dead set on outsourcing work to “save money”. While we’ll respectfully disagree with you, we’ll kindly connect your business to a new sister shop located in the Ukraine who exclusively focuses on outsourcing, something which OpenRain doesn’t do. Both OpenRain and Railsware focus on Ruby development for U.S. companies, and are pleased to announce this partnership so we may jointly work towards building a bigger, better Ruby development industry as a whole. We’d love to have you in it!
Welcome to the first of many posts in the OpenRain Tips and Notes series. We’re going to use this space to share some of the tips, tricks, howto guides, and notes, that we use internally to keep us productive and make us happier programmers.
Today, we’re going to learn how to get your brand new shiny Mac OS X machine setup for Ruby and Ruby on Rails development. When we’re done, the full software stack will include Ruby 1.8.7, Rails 2.1.0, MySQL 5.0.51, and Mongrel 1.1.5.
And, who might you be? A programmer, comfortable at the command line, running on Mac (Leopard, 10.5.4), and interested in Ruby and Rails.
Preamble
Setting up a complete Ruby on Rails environment for local development can be overwhelming, especially if you’re new to it, but even if you’re done it before. Depending on your level of comfortability, there several ways you can setup Ruby and Rails on OS X from scratch, so please keep in mind that this guide is one of several “right” ways to do this.
The most “right” way to setup Ruby, Rails, MySQL, and Mongrel on your Mac
Xcode and MacPorts

Download and install a copy of the Xcode Developer Tools DVD image from Apple’s Apple Developer Connection. Membership to ADC is free and highly encouraged if you’re doing any sort of software development for the Mac. It’s a good source for all your Apple programming activities. [Download > Developer tools > Xcode 3.1 Developer DVD (Disk Image)].
Download and install a copy of MacPorts. Since Mac OS X is a descendent of Unix, you can download, compile, and install all sorts of existing Unix software on your Mac. However, doing this manually becomes tiring almost immediately since you have to manage versions, dependencies, and conflicts all by yourself. The MacPort system is a convenient tool for managing the life-cycle of source-based installations. Any software that MacPorts installs, is kept separate from the software that comes with your Mac.
Update your environment variables
Once MacPort has been properly installed, modify your $PATH and $MANPATH environment variables with the location that MacPorts installs all it’s software in.
For example, in ~/.bash_profile:
export PATH=~/bin:/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
Ruby, ruby, ruby

The good news is that, on Leopard (OS.X 10.5.4), Ruby is an officially supported language. Out of the box, this includes:
- the warm fuzzy feeling of Ruby running on OS X
- the ability to debug Ruby processes with dtrace
- integration with Cocoa via the RubyCocoa bindings, and
- using Ruby to control and message OS X applications via the AppleEvent infrastructure
The bad news is that updates don’t flow as fast from Apple so, for instance, running the latest version of Ruby, (1.8.7 as of this writing) isn’t possible unless you roll your own Ruby and RubyGems environment.
To install Ruby and RubyGems from the command line:
$ sudo port install ruby
$ sudo port install rb-rubygems
RubyGems for Rails and everything else

Once you’ve got RubyGems installed, setting up the rest of your system is easy to do from the command line:
$ sudo gem install rails rake capistrano capistrano-ext libxml-ruby mongrel hpricot

This installs Rails, as well as a bunch of other useful gems into:
/opt/local/lib/ruby/gems/1.8/gems
Install MySQL (Option 1: via MacPort)
There are two options for installing MySQL. Option 1 continues to use MacPort while option 2, a little further down the page, uses the binary installer. Either option works well.

$ sudo port install mysql5 +server
$ sudo -u mysql mysql_install_db5
$ ln -s /opt/local/share/mysql5/mysql/mysql.server ~/bin/mysql.server
The first and second command installs and setups MySQL5 via MacPort. The third command sets up a convenient helper script which you can use to start and stop MySQL server from the command line:
$ sudo mysql.server {start|stop|restart|reload|force-reload|status}
Optionally, you can configure MySQL to start up automatically when OS X boots.
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
Install the native MySQL driver
Out of the box, Rails comes with a pure-Ruby MySQL adapter, though all production Rails environments running on MySQL will use the native binary drivers since they are considerable faster. To get the native MySQL drivers from the command line:
sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
Install MySQL (Option 2: via the binary distribution from mysql.com)
One alternative to installing MySQL from MacPort is to install the binary distribution from mysql.com.
Download and install the DMG.
Optionally, you can install the System Preferences panel and a startup script which starts MySQL up along with OS X.
Install the native MySQL driver
Similarly, you’ll also need to configure the MySQL RubyGem driver
$ sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-include=/usr/local/mysql/include/ --with-mysql-lib=/usr/local/mysql/lib/ --with-mysql-config=/usr/local/mysql/bin/mysql_config
Fin

That wasn’t too bad. If you followed the directions correctly, your shiny new Mac should be properly setup with Ruby 1.8.7 and Rails 2.1.0 running on MySQL 5.0. For performance purposes we also installed Mongrel and the MySQL native drivers which are automatically used by Rails during development.
A super secret cheat sheet:
Install Xcode 3.1
Install MacPort 1.600
sudo port install ruby
sudo port install rb-rubygems
sudo gem install rake rails capistrano capistrano-ext libxml-ruby mongrel hpricot
sudo port install mysql5 +server
sudo -u mysql mysql_install_db5
sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
- What: Geek ‘n’ Eat (Phoenix) VII
- Where: Pacific Seafood Buffet, Chandler. [map]
- When: Friday, August 29th, 2008. Noon - 1:30PM.
- Who: Computer geeks, dorks, nerds, wizards and wannabes.
- Why: Geekery, networking, and, of course, food!
Agenda
- Geek
- Eat
Phoenix is home to many closet-Rubyists doing .NET, Java or C++ during the day, ripe for a change to something more… productive. The difficult part is that Ruby as a profession is a growing marking. Enterprise CxOs aren’t yet clamboring to migrate internal applications to Ruby-based stacks, but are starting to take notice because their developers are drinking the Kool-Aid.
Don’t miss the early years and get your feet wet on real projects. Send us a note and take those mad Ruby development skills you’re keeping hidden for a ride!
DEFCON is an annual hacker convention event held in Las Vegas. It’s currently held at the Riviera on the North end of the strip and is happening this Friday through Sunday: August 8th-10th.
This year, we decided to rent a 15-passenger van and roll in Puff Daddy style with most of the OpenRain crew and other Phoenix nerds. Ping us if you’ll be in Vegas for the event!
On Wednesday, August 20th, 2008 we’re hosting a free event at OpenRain HQ with Refocus Phoenix to get your computer monitor rendering colors correctly. If you’re a web designer, photographer or other graphics professional that is not using a custom color profile, this is a must-do process. I mean it. You owe it to your clients. We ran a tiny experiment to see if people found our internal profiles valuable and the feedback has been tremendously positive, so it’s time to take it up a notch. The process is..
- Bring in your monitor. Laptops and personal machines are more than welcome, too, but you’ll need to install the software component of the calibration tool. (I doubt it’ll run on Linux, sorry.)
- We strap on a hardware colorimeter and run some software. (Takes ~20 minutes, depending on the tweakability of your monitor.)
- An .icc color profile is generated with which you keep, use and immediately benefit. OpenRain uses and recommends OS X for graphics work, in which we have had no issues with custom .icc files.
There’s no substitute for having a profile created for your specific monitor, and it’s happening here for free in August!
To design out any issues with unattended hardware, we’ll provide pizza, soda and water so you can stay close to your beloved monitor at all times.
OpenRain HQ
Wednesday, August 20th, 2008
6:30 - 8:30ish
Food will be hot at 6:30.
Please post any questions to this thread and/or the Refocus Google Group.
I don’t think the open house could have gone better. Major thanks to everyone that came out to show support, and extra-special props to Gracie (OpenRain Office Manager) for handling the catering arrangements and running it so smoothly. We had a perfect amount of food and drink and saw plenty of smiling faces. In fact, we had so much fun that we’ve already decided to do it again next year!
Sweet flickr slideshow and thumbnails.
For those that couldn’t make it because you were being held hostage and/or having a baby–the only two possible reasons for missing it–you’re still welcome to drop by, and we’ll have more announcements out over the next couple weeks (via this blog, of course) on more sponsored summer events!
- Preston

It’s time to celebrate our office upgrade to Mesa, Arizona at the OpenRain Open House this Friday with friends, family, and the Phoenix tech community over food, drink, and games. This is an open invitation to you and everyone else in the Phoenix area that enjoys the design, development, and business of web software. OpenRain is growing and it’s because of you.
OpenRain HQ
Friday, July 18th, 6pm-9pm.
Catering will be provided around 6pm.
To assure ample food and drink, please RSVP using the form at the bottom of the OpenRain homepage.



