Skip to main content

Posts

Showing posts from July, 2012

Getting RMagic and friends to work on OS-X Mountain Lion

Upgraded my ruby environment today to Mountain Lion.

Here is a quick checklist that I went through to get everything working.  The largest change was having to reinstall XCode and command line tools, and also download XQuarts in order to reinstall ImageMagick successfully. Without it, I was getting errors building RMagick of the following shape:
ld: file not found: /usr/lib/libltdl.7.dylib for architecture x86_64clang:
error: linker command failed with exit code 1
(use -v to see invocation)make: *** [RMagick2.bundle] Error 1

Quick checklist: Install Mountain Lion Install XCode 4.4 Install command line tools from XCode 4.4 Preferences dialog Install XQuartzIn terminal run brew update brew uninstall imagemagick brew install --fresh imagemagick wipe out your ~/.rvm folder reinstall RVM and install the latest ruby 1.9.3-p-194 run "bundle" in the project folder run "rake" and rejoice
References:

https://github.com/mroth/lolcommits/issues/65

Activity Feed Design

I normally don't publish work diagrams, but this one sort of looks like work of art.

It represents a collective design we came up with around aggregation of activity feeds on wanelo.com. If you have an account, you will soon see the results of this on http://wanelo.com/following


Using CarrierWave with a dynamic fog host and a CDN

Another simple case of "this took longer than it takes to look up this issue on Google" :)

CarrierWave is a fantastic and well supported ruby gem for managing images, including support for cloud storage like Amazon.

Whether or not you use CarrierWave on the cloud, you almost always want to put your user-uploaded images behind a CDN.  There are many CDNs available, including Amazon's CloudFront, Fastly.com, CacheFly, Akamai, etc, and comparing them is outside the scope of this article. 
Because browsers, especially older, are limited in how many connections they will establish to a single host, it is sometimes beneficial to have images load from several alternating URLs, for example: http://cdn-0.wanelo.com http://cdn-1.wanelo.com http://cdn-2.wanelo.com
etc...
CarrierWave supports fog_host variable which can be set to either a string (a static hostname), or a lambda (if for example a randomized string is desired) and the usage is well described here.
Unfortunately, due a b…