Friday, December 31, 2010

vim tip: searching for word under cursor

I was motivated to use vim a few years ago, after watching Corey Haines do his number to LCD kata at the Simple Design and Testing Conference (SDTConf). Although I learned the basics while I was in college, I never really tried to progress beyond that until recently.

Now I try to make a habit of whenever I am doing something that just seems like it's the hard way, I'll google it and learn how to do it better.

Today, I was thinking: there has to be a better way to search for things rather than typing "/thing_to_search_for". So I found out how to search for the word under the cursor, which is # for searching backwards, and * for searching forwards.

Hope this helps, and motivates you to keep learning something new everyday.

Thursday, December 23, 2010

Installing ruby 1.9.2 with rvm

I've been having trouble installing ruby 1.9.2 with rvm on Mac OS X.
Although there are lots of great blog posts with solutions, for some reason, none of them worked for me.

The rvm page and many posts say to pass --with-iconv-dir to rvm install.
However, I kept getting errors about Tcl/Tk not being 64-bit, and iconv also not being 64-bit.
Why would it be complaining about iconv, especially since I used rvm to install it?



I noticed the config.log spit this out:

configure: WARNING: unrecognized options: --with-iconv-dir


I tried many options that were in configure, but none of them pointed the makefile to rvm's version of iconv.

So I took a look at /usr/local/lib/libiconv.2.dylib and noticed it was a symlink.
Perhaps this is taking the easy way out, but I backed it up by renaming it, and relinking that to the version inside $rvm_path.
After that, I recompiled by running:

 rvm install 1.9.2 -C --enable-shared


Success!
The output:


Hopefully, this helps some of you out there with similar problems.

Sunday, December 05, 2010

Installing Nokogiri with bundler

I recently decided to start contributing to open source, so I chose to look at one of my favorite Ruby gems, rspec.
The instructions to get you started are fairly straightforward; however, in the rspec-core repository, bundler was failing to install nokogiri.  Although the instructions here worked for some, it didn't work for me.  So based on the instructions on the Nokogiri homepage, I used macports to install libxml2 and libxlst, re-ran rake, and finally, bundler was able to install nokogiri, with no problems.