Photo-1 Photo-2 Photo-3 Photo-4 Photo-5 Photo-6

@brentmc79

@brentmc79

Full-time web developer. Part-time smart ass.

I'm Brent Collier.

After a year and a half as an engineer on Twitter's Trust & Safety team, I'm looking for my next gig. Contact me if you know of something interesting.

#

Snow Leopard Rails Dev Setup Guides

Posted on 03/05/2010

You can never have too many.

Much like every new version of OSX, there have been a plethora of "How to install BLANK on Snow Leopard" blog posts and walk-throughs detailing all the little tips and tricks around how to install some tool or piece of software.  Having a lot of options is awesome, but in the words of the great Biggie Smalls, "mo' blog posts, mo' problems".

That IS how it went, right?

Anyway, with all of these walk-throughs, how do you know which ones are good, and which one just suck.  Well, you don't really...

So here's a list of a few [confirmed] valid and useful dev setup walk-throughs:


First, this is actually a series of posts, as opposed to one single write-up.  Actually, its not even a series of posts.  Its just the search results for 'Snow Leopard' on the Hive Logic site.  So really, its only the first 3-5 posts that matter.

http://hivelogic.com/search/results/a7a831b978f2667fa301ea095d3d8fa7

This is the route that I personally followed after a fresh install of Snow Leopard, and I had everything up and running in no time.


Next, Robby On Rails did a thorough and entertaining post on Snow Leopard Rails dev env setup, or SLRDESU for short.  Acronyms make everything better (AMEB).  I don't know about you, but Robby's older post about getting setup with Passenger came in handy for me on more than one occasion.

http://www.robbyonrails.com/articles/2010/02/08/installing-ruby-on-rails-passenger-postgresql-mysql-oh-my-zsh-on-snow-leopard-fourth-edition

His latest post covers everything from start to finish, and he even included a few video to pass the time while waiting for binaries to build and whatnot.  I haven't personally used this walk-through, but based on my previous experience with Robby's posts, and the recommendation from coworkers, I'm sure it'll get you where you need to be.


Another noteworthy mention comes from the guys over at Thoughtbot, the makers of such wonderful tools as Shoulda, Paperclip, and Factory Girl.  Their robot-laden guide goes beyond just Rails/dev-related stuff, and covers the likes of several generally useful OSX tools.  Things like Quicksilver, Fluid, and Firefox/Firebug.

http://robots.thoughtbot.com/post/159805668/2009-rubyists-guide-to-a-mac-os-x-development

This is another one that I haven't personally used, but I think we can trust the guys over at Thoughtbot.  After all, their company reputation depends on it!


So there you have it.  Three different hand-holding recipes for getting you set up on Snow Leopard.  If you haven't upgraded yet, what're you waiting for?  Get to it!

#

Geoip_city gem install on Snow Leopard

Posted on 12/28/2009

I had recently upgraded my MacBook Pro to OS X 10.6 Snow Leopard, and I was in the process of reinstalling most of the ruby gems.  The geoip_city gem was the only one that gave me a bit of trouble, so I figured I'd post how I got it working.

  1. Go here and download the latest source for the GeoIP C api
  2. Untar the source, cd into the directory
  3. Run ./configure
  4. Then run make && sudo make install
  5. Finally, run sudo env ARCHFLAGS="-arch x86_64" gem install geoip_city -- --with-geoip-dir=/opt/GeoIP

The key is the ARCHFLAGS parameter in the last step.  This indicates the native extensions are to be built for a 64 bit architecture.

Also, if you need the free GeoIP City Lite database, you can find it here.  I hope this helps.

#

Access Your Passenger App From Windows

Posted on 10/27/2009

Eww, Windows?

Yeah, I said it.  As we all know, there's a million and one schmucks out there still rockin' Internet Explorer as their default browser.  That means if you want that spreadsheet-in-the-cloud app you've been working on to hit critical mass, you better test it in IE.

If you're like me, then you've recently started running some or all of your apps locally via Passenger.  This can cause a bit of a problem when it comes time to test in IE.  At least, it did for me anyway.

I use Parallels for my Windows testing, and an old version at that.  From what I hear, VMWare is better, but I'm too cheap to buy it and I just don't really care that much.  Prior to using Passenger locally, I would just point IE at my mac's IP address, port 3000, and everything was kosher.  Well, with Passenger, that no worky.

Now, I'm sure there's probably a way to configure Parallels to allow me to test a Passenger app, but from what I can tell that either requires an updated version of Parallels or more time Googling than I'm willing to spend.

I knew that I could access my local Apach instance from any machine on my home network, so I figured there's got to be a way to hit my Passenger apps since they're running under that same Apach instance.  With a little help from a fellow Intridean, I got it working.

Here's what you do:

1. Set your app up in Passenger, like you normally would.  I use the pref pane.

passengerpane.png

2. Determine you mac's IP address.  An easy way is to look in the sharing section of the System Preferences.

sharingprefpane.png

3. On your Windows machine, add an entry to the hosts file with your mac's IP address and the app's domain (local) domain name.  The host file is in C:\WINDOWS\system32\drivers\etc.

hostsfile.png

That's it!  Point IE at http://yourapp.local and you should be golden.  This will work for subdomains also, assuming you've added the *.yourapp.local alias to you Passenger conf.