Category Archives: Tech

Bundler Failing to Build Native Extensions

It was apparent that my 2011 MacBook Air needed a rebuild when it would sit, sometimes up to three minutes after coming back from sleep, screen lock, or restart, loading the login screen. I have worked at three different places of employment with this laptop, each place requiring a number of different processes and applications running on the machine in order for me to work effectively. It had finally become out of control and enough was enough. I wiped the machine and performed a fresh install of Mavericks.

Everything was going very smoothly until it came to install my gems for the current Rails project I am working on. Every single time I would try to bundle install gems, I would get the same error, for different gems. The one erring out below happens to be the do_postgres gem, but the error was always the same:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... yes
checking for mb/pg_wchar.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created

extconf failed, exit code 1

I must have Googled a hundred sites. Most answers I found suggested to install the Xcode command line tools. I did that. And did it again. And probably again, just because I’m a little insane like that. Other people suggested that it was a Postgres issue and simply uninstall Postgres, reinstall and observe the magic. There was no magic for me. Nothing.

Frustrated, I typed gem install do_postgres from the command line, not using bundler. It worked! But why? Finally my awesome husband and I sat down to figure this out.

We found an issue similar to mine here and TimMoore stated “I’d bet that the problem is that Bundler itself is installed as gem under the system Ruby, rather than the one in ~/.rubies.” Bingo.

I use rbenv to manage my Ruby versions. It seemed for some reason bundler was using the system Ruby rather than what was specified by rbenv. I wish I could go back in time to verify this, but odds are, for some reason, I installed bundler before I installed rbenv. I don’t know why I would have done that, and I honestly do not remember. We updated the /usr/bin/bundler to look in /Users/jpayne/.rbenv/shims/ruby rather than /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby and that worked.

I, of course, was not going to accept that updating that file was the solution, so I uninstalled bundler, went back into my project directory (with my rbenv gemset in place) and reinstalled bundler. I then did a bundle install to try it out and was extremely pleased to discover that building the native dependencies for all gems had been successful.

My laptop is now a bit speedier because of the rebuild, and I have my project up and running again.

erubycon 2009

Yep. I’ll be there! Loved it last year and looking forward to it this year as well. Hosted by EdgeCase, it’s a conference that presents Ruby and Ruby on Rails as a solution for the enterprise. Held in Columbus, OH, it’s relatively close to home for me, which makes it convenient, and the lineup of speakers is great. See the erubycon site for more information, and better yet, register while you’re there. Early registration ends Monday and is $250, but even at the full price of $299 it’s still well worth attending.

I’m Not the Geek I Want to Be

have always considered myself a geek. I’m into the programming, have really enjoyed learning Ruby on Rails, love doing anything on my Mac, get silly over little changes in the iPhone OS, and even though I haven’t used it as much as I want to, I get excited when there is a new iPhone SDK beta. But I did realize something today. I am not nearly as geeky as I want to be, or should be. And that is a bad thing.

My family thinks I am the biggest nerd. When I start talking about what I do at work their eyes glaze over and they kind of nod and look really confused. They’ll never get it. To them I am the epitome that they think about when they think of someone who is geeky. Little do they know that it’s really a farce.

Until recently, I really thought that I had come a long way in terms of learning Ruby and Ruby on Rails. Every day I was becoming more and more confident and not afraid to suggest better ways of writing the code or taking criticism from others concerning my code. But today I took a step back. I looked at how long I’ve been doing the Rails thing (oh, about a year-and-a-half) and exactly where I’m at, or feel like I’m at (advanced beginner at best). After a year-and-a-half I really think I should be further along than I am. There are times when the simplest things stump me and render me useless. There are also times when I feel like I am a joke, plain stupid and dare I say it, ditzy. Sure, Rails is ever-changing. Yes, we’re trying different things all the time. Alright, although Rails makes everything seem easy, we’re doing a lot of work that is very complex. Excuses. I should be better. I need to be better.

This past year, I took on teaching myself a little iPhone development because not only am I interested in how applications work, I thought it would be interesting to learn something new. I now think I took on too much. Now, I am not required by anyone but myself to put out an application, but it’s been disappointing to me to really get nowhere with it. I see all of the awesome applications that others are making and think “Hey, I can do that,” but the truth is that I’m not doing that. I’m not even sure if I can anymore.

A friend of mine told me today that it’s probably difficult for me to be exactly where I want to be because I am very occupied at the moment with being a mother. I do have two full-time jobs, the one I go to during the day, and the one that I go home to in the evenings. He said that it’s either get rid of the kid and focus on being the geek or keep the kid and be half-mom, half-geek. Well, of course I am not getting rid of my child, but I don’t feel that half-geek is acceptable either. I need to be good at something. I would like that something to be programming.

I by no means intend for this post to be a “feel sorry for me” kind of thing; That is not why I’m laying it all out like this. This is my blog and I needed some therapy. I’m even disabling the comments on this post because I’m not really looking for advice right now, just a means to vent. I guess I have issues. But you know what? It happens. There are times when everyone feels inferior, even people who know what they are doing.

I think this will pass and I’ll eventually be back to my chipper self, but I also believe it was time for me to take inventory and figure out what to do. I think I’m on a new mission now, to really figure out the best way to retain what I learn. Maybe find a new way of thinking. I’m going to continue reading books, writing code, and doing what I can to understand what’s going on around me but hopefully try to gain a new perspective along the way.

Background Processing with Nanite

Below is a short presentation I gave to my team about Nanite and the benefits of using it for background processing. Unfortunately the slide show notes are not available but at least you can get an idea of what I talked about and where I got my information.

The application that I work on, written in Ruby on Rails, was previously using BackgrounDRb for its background processing but we have decided to give Nanite a try because of its flexibility and scalability. I’ve been very pleased so far with the choice.

Required Reading

Ok, so I’m not really “required” by anyone to read technical books but I did resolve this year to try to read at least one per month.  My boss is helping me out a bit by suggesting books for me to read and so far I’m happy with what he’s selected.  First up: Pragmatic Version Control Using Subversion by Mike Mason.  I got a bit of a late start on this book in January but I finished it up this week and it was a surprisingly excellent read.

Thinking about my work goals for the year, I tried to consider things that I didn’t necessarily deal with directly but probably should know more about.  So when I thought about Subversion I realized that even though I knew how to “use” it I didn’t really understand what was involved with setting up and maintaining repositories.  I also needed help with my severely lacking command line skills and wanted to better understand the version control process and why we do things we do at work when it comes to version control.  Thankfully this book was very clear in explaining the concepts and even provided some helpful tips and tricks.

I especially enjoyed chapters 9 and 10 which dive into how exactly tags and branches should be used and how to organize projects.  This was exactly what I was expecting to learn more about when I started to read this book and I was not disappointed.  I’m looking forward to putting what I have learned into practice.  Maybe with my iPhone app?  Ha.  We’ll see.

If you use Subversion I highly recommend this book!

“We only have tequila… It’s like beer” or “How I became a programmer”

It takes some people years and years to decide what they want to do in life but I was lucky.  I can truly say that I knew in high school that I was going to and was meant to be a programmer.

 

It all happened kind of by accident when my family moved and I started the tenth grade at a different high school.  As my guidance counselor was going over the classes I had chosen to take that year at my previous school, she enrolled me in their equivalents at the current school.  Trigonometry, Physical Education, Chorus, American Studies, and English were all available at my grade level but as she made her way down my schedule she couldn’t seem to find a match for my last elective, Keyboarding.

 

When the guidance counselor at the new school asked me what “this Keyboarding” was, I told her that Keyboarding was a typing class where students were taught how to type on an electric typewriter keyboard.  I informed her that I took it as a “fun thing to do” during activity period and decided that I liked typing so much that I wanted to take on the full-blown class the next semester.  ”Oh,” she said, “we don’t have Keyboarding here but we do have BASIC.”  ”What’s BASIC?” I asked, to which she replied, “It’s like Keyboarding.”

 

Now every time I think of what she said, “It’s like Keyboarding,” I always think of the scene in Three Amigos when the Amigos walk into a Mexican bar and ask for a beer.  When the bartender informs the three that the bar only serves tequila, they ask what tequila is.  The bartender replies “Oh, it’s like beer.”  Makes me laugh every single time because to me the situation could not be more relevant.

 

Who knows where I would be if I realized that taking that one BASIC course would mean years of learning difficult, complex concepts and having to take Calculus and eventually Statistical Inference.  In high school I stayed as far away from math and science as I possibly could.  Why would I want to pursue a career where those two things would be blended into a something that I would use daily?  In the end I’m thankful that guidance counselor had no clue what BASIC was.  She may never realize it, but  that misunderstanding is the single reason I am where I am today and I could not be happier.

I’m a Programmer and I’m Proud

Through the years I have come to realize that the life of a programmer is far from a glamourous one.  Even though I am thoroughly excited about my chosen profession and can blab for hours to family and friends about how much I really do love Rails or exactly what it is that I do for a living, they kind of nod and smile and just don’t get it.  At a wedding a few years ago, an old friend asked me what I did for work.  When I told her that I was a programmer I was greeted with a blank stare.  I went a little further: “I’m a computer programmer.  I write software for a healthcare company.”  Her reply?  ”I’m sorry.”  I’m sorry?  Sorry for what exactly?  That I’m doing what I want to do and am excited about a career that I love?  I remember  walking away thinking that my life as a programmer is nothing to be sorry about but not saying anything to that effect.

Recently, I went to dinner with a group of friends, many  who I have not seen in 10+ years.  Of the five others I met with three are or were educators, one is a telemarketer, and the other a production assistant for film and television.  As the teachers talked to each other about the trials and responsibilities of feeding the minds of today’s children and the production assistant spoke of her escapades with the stars, I sat there listening to their stories.  At first I thought “Wow.  Those teaching really seem to make a difference and [my production assistant friend] sees all of these stars and works on movies.  My job is so boring compared to theirs.”  But do you know what?  I heard the sounds of their voices as they talked.  They lacked passion, desire, and excitement.  To them, what they do is a job.   Something they wake up, do for a few hours and try to forget about when they go home.

I’m not saying there are not times when I wish I were not a programmer or times I don’t hate my job.  Everyone has their days.  I’m just saying that it’s very difficult to be bored in a field where everything is constantly changing and there is so much to learn.  It’s hard to not love the design and code you’ve put your all into and it’s impossible not to be passionate about a product that you have created or helped create from scratch using your own brain.

I’ve been fortunate to work for some very well-respected companies and on a few intense and challenging products.  My colleagues have proven to be exceptional, knowledgeable, diverse, interesting and fun to work with and I can truly say that I enjoy going in to work every morning.  I look forward to what challenges await me during the day.  So please, don’t feel sorry for me.  Although the outside world might think programming is dry and boring I think exactly the opposite.  I can’t see myself doing anything else right now because I love what I do.

Praise For Twitter

One does not have to search very hard on the web to find articles that speak of reasons not to use or why people have given up on Twitter.  I’ve read arguments that Twitter, and its contributors, are boring, heard complaints of too much noise and griping about its unreliability. Even in my office groans pour out of the cubes when the Fail Whale rears its head.

I, however, could care less about all of these downfalls.  Twitter is a free service.  If you don’t want to use it and think that it’s doing you a disservice then by all means do not use it!  If you can look past the negatives, you may discover a tool useful for networking, friendship, and entertainment.

Twitter, when it comes down to it, is pretty entertaining

My Twitter following breakdown goes something like this:

  • News/media outlets
  • Internet/media celebrities
  • Family/friends
  • Coworkers
  • People I do not know personally but find worthwhile to follow

I follow news and media outlets such as Fox News, CNN, Fark, and various gossip sites because I find it convenient for news to come to me rather than the other way around.  I have Twitter set up on my mac to use Growl, so any time a tweet comes through, I see a visual notification.  Sometimes this creates a lot of noise, but I never miss a headline.

I’ve always been the type that loves celebrity gossip.  Maybe it’s that voyeuristic look into a life that I know I’ll never have, but there is something about celebrities that fascinate me.  Following them, even minor internet celebrities, on twitter gives me a little more of a personal peek inside their heads.  It’s surprising sometimes what is revealed.

Following family and friends is a given.  I love to see what everyone is up to on a day-to-day basis.  Yes, my friends are boring in the whole scheme of things, but it is important to me to know how they are doing and feel a connection with those I cannot physically see or talk to daily.

I’m fortunate to work with people who are funny, talented, laid-back, and intelligent and I follow them because of these reasons.  On Twitter, there is always a running inside joke going on between us and it’s fun to take stabs at each other knowing the rest of the group will read it and get a kick out of it.  It’s also nice to see what project people are currently working on or what they feel like having for lunch.  Yes, we all sit next to each other in cubes.  It’s difficult to explain.

People who I don’t know very well provide a wealth of entertainment.  I tend to follow people who are interesting or funny.   Some tweets from “Twitter friends” keep me hanging on, waiting for more and others make me laugh out loud.

Twitter friendships are worthwhile

I love my Twitter friends – the people who I have met and know from Twitter alone.  They are people who I have never seen face-to-face but feel a connection with through the tweets that they post and my interaction with them.

I’ve sought advice from and given advice to these friends, have laughed with them at the silly things that happen around them, sympathized with them through their trials and have viewed their posted blogs, Facebook pages and photos to get to know them more.  When I view my received tweets, I am delighted to be greeted with posts from these once strangers, now friends.

Twitter is by far the best networking tool I have used

I am usually a shy person.  In order to go up and talk to someone I do not know and attempt to carry on a conversation, I have to mentally prepare myself well in advance.  This does not always work out in social situations.

A couple of weeks ago I attended erubycon.  It is a conference that is presented and attended by many influential people in the Ruby community.  Before the conference, I started following erubycon on Twitter and shortly after the organizer, Joe, started following me and I followed him in return.

Through Twitter I was able to learn what Joe was doing to organize the conference, discovered his love for fine scotch, and realize how passionate he is about what he does.  It is so interesting getting to know someone this way.

When I arrived at the conference, I was excited to meet him because of all I had read about him.  Had our Twitter relationship not been established prior to the conference, I doubt that I would have talked to him at all, which would have been terrible!  I probably would have never attended the after-conference get-together, at which I was able to get a lot of face time with some truly exceptional people in the Ruby community.  It was, without a doubt, one of the most positive experiences of my professional career.

Keep on keepin’ on

Say what you want about Twitter.  Complain when you see the “Whale of Fail” and gripe about it’s unreliability.  I will continue to use the service to keep me informed, make me laugh, meet new friends, and establish contacts.

Oh look, I haven’t tweeted in a few hours.  Time to take care of that…