Installing Native Gems with Custom Library Paths

by Calvin on September 6, 2009

A few weeks ago, I started using the Patron Gem for Skribit and ran into an issue on our CentOS production servers which uses a very old version of libcurl.  I got it working by compiling a new version of libcurl and building the Gem against those binaries.  Since I didn’t want to overwrite the libcurl that CentOS provided, I installed the binaries in another location instead, and updated the LD_LIBRARY_PATH environment variable so Rails could properly load the Gem.

A couple of days ago, Paul brought to my attention that using LD_LIBRARY_PATH isn’t a good thing.  While I didn’t necessarily think it was a big deal, it did peak my curiosity on how I would get this work without it.  Here’s the command I finally used to get it to work:

The key part is the –with-ldflags option at the very end.  The -Wl,-R<path> option adds the given path to the list of paths the linker will use to find libraries at runtime.  Hopefully, someone will find this information useful, since I couldn’t find this information myself on the ‘nets anywhere.

{ 0 comments }

Just recently done a 2 week stint working on Windows while Apple Geniuses were working on my MBP, I thought it would be a good time to blog on my own Skribit Suggestion and reflect on my switch to Mac 14 months ago.

Reasons for Switching

Prior to my MBP, I’ve was working on a personal HP laptop that was on it’s last leg.  My screen had started developing an assortment of 1 pixel vertical lines and the keyboard would randomly doouble typed keys.  I had a choice to make – I can either get another (and better) Windows laptop, or do the the switch.  Ultimately, I decided on switching.  Here were my reasons.

Apple made great looking laptops that looks good too

Apple really makes some really good looking laptops, but it’s easy to forget that they they’re functionally great laptops too.  When my wife first got her MacBook, I was amazed at how everything looked so crisp on it.  And speaking as someone that has broken a power connector on a laptop before, MagSafe is a must-have awesome feature.

A Unix based Operating System

When you do development, working on a Unix based environment with a real command line is a big advantage.  Cygwin can help bridge that gap on Windows, but it’s nothing like having a terminal that can size itself properly and not having to constantly translate Windows paths to Unix paths and vice versa.

Another benefit of having a Unix OS is that Open Source software plays much better on it than on Windows.  Most OSS is developed to target Unix first, Windows second.  When working on Elf Island on Windows, my workflow while working on the game (which is developed primarily using OSS), involved starting two different services from Windows System Tray, starting another service from the Windows Services, and finally running a few commands from Cygwin.  I can do the equivalent of all that from the command line on a Unix environment.

A Paid-For Software Friendly Ecosystem

For some reason, it seems that Mac users are willing to pay for software, and as a result there is a lot of reasonably price software for Macs.  Doing software development myself, I can appreciate and definitely want to support this line of thinking.  Sure, Windows has tons of commercial, paid-for software, but I can’t say I feel comfortable about downloading them for fear of excessive ads, poor installations practices, and/or spyware.

Experiencing Something New

Probably the biggest reason for doing the switch is that I’ve been using Windows for years.  It was time for a change - a change for changes’ sake.  Programmers are told that they should regularly learn new languages to keep their skills sharp and to explore new ways of doing things.  It should be the same with the software you use as well.  If you develop software, you owe it to yourself to see how the other side does it to gain some perspective.

Conclusions

So after a year of working fully on the Mac, here’s are some things I like and don’t like about my OS X:

Pros

  • Windows Management. It took a while getting used to, but I have grown to prefer Command+Tab & Command+` to Windows Alt+Tab model.
  • OS Degradation. With my prior laptop, Windows had greatly degraded by it’s first anniversary.  I haven’t experience that with my MBP yet.
  • Great TrackPad. When programming, I try to stay on the keyboard as much as possible, but I find that transitioning between the trackpad and keyboard on my MBP the easiest of any laptop I’ve used before.

Cons

  • Keyboard Shortcut Images. For some strange reason keyboard shortcuts are still displayed using icons (Apple Keys) that in some cases are no longer shown on the keyboard.  Trying to remember what icon is what key can feel like akin to decipher hieroglyphics.
  • Alt Key Menu Access. I miss how the Alt key in Windows gave you keyboard access to the application menu.  I often used that function keyboard shortcut.
  • I Miss My Alt+Ctrl+Delete. I kind of feel that Windows does a better job of preventing errant applications from locking up the whole OS.  I attribute that to Window’s plentiful experience with crashes and lockups.  It seems that lockups on OS X are more catastrophic (requiring a hard reboot) than they should be.
http://macromates.com/

{ 3 comments }

Problems Uploading Files to WordPress?

June 25, 2009

A Google search seems to indicate that problems uploading files on WordPress installs is a pretty common occurrence.  Unfortunately, I had the hardest time finding the solution to my particular ailment.  Hopefully, this post will find those others who run into this problem in the future.
From the WP Admin pages, go to Settings > Miscellaneous.  [...]

Read the full article →

Creating Static Pages w/ Rails ActionViews

May 24, 2009

Recently, I needed to create some static reporting pages for Skribit.  From a quick search, I got a lot of results that talk about Rails and static pages, but none did exactly what I needed:

To be able to generate pages with different paths from one URL
Pages to persist across Rails deployments

Not seeing any solutions that [...]

Read the full article →

Building Software to their Audiences

February 24, 2009

When building software, it’s a good idea to identify the needs of 3 different kinds of audiences.
The first 2 kinds are obvious ones.  We know to listen to what our End Users ask for, but not necessarily build everything they ask.  And we want to balance what the Business wants with when they want it.
The [...]

Read the full article →

Turning a New Page

November 15, 2008

It’s been a month now since I left my contract at AutoTrader.com.  For the most part, I’ve enjoyed my time there, but the thought of celebrating my two year anniversary there was a little frightening.  While I am very adaptable to the corporate life, it isn’t for me.  When FlickStation (the last startup I was [...]

Read the full article →

Growl Notifications for Ant

October 18, 2008

It’s a real refreshing change to be doing developing on Mac these days.  Currently, our Ant builds at work are less than optimal, taking ten’s of minutes to do a full build.  Fixing it is something we definitely want to do, but because of the complexity of the build and existing deadlines, right now isn’t [...]

Read the full article →

Moving Off WP.com

October 7, 2008

So after three months of WP.com, I’ve decided to move back to my own hosted WordPress blog.  One reason for the move was so that I can beta test our Skribit widget, which can now be easily styled to blend perfectly to your site.  Please give it a shot, and shoot us any feedback.  Right [...]

Read the full article →

Running FiveRuns TuneUp in a Separate Environment

October 5, 2008

FiveRuns’ TuneUp is a great tool for profiling your Rails app, but by default it is always running in development. This causes two issues 1) every request is slower in development as it is always collecting profiling data, and 2) the TuneUp bar can mess with the layout of your application, especially if you’re [...]

Read the full article →

Aptana Goes into the Clouds

September 7, 2008

I use Aptana for RoR development.  Not because it’s a good Ruby or Rails IDE, but because I do so much Java at my paying job and switching between Java development on Eclipse to RoR development on Aptana is a breeze.  Today, I was checking out Aptana’s website for updates when I noticed that they [...]

Read the full article →