This worked for me on 2014-02-20 after MUCH searching! brew tap homebrew/dupes brew install apple-gcc42 export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2 sudo mv /usr/bin/g++ /usr/bin/g++_apple sudo ln -sf /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 /usr/bin/g++ gem uninstall libv8 gem install therubyracer -v=0.11.4 sudo mv /usr/bin/g++_apple /usr/bin/g++ See also http://stackoverflow.com/a/21453272/120818
Author: herbcso
Switching from Rails’ standard testing to RSpec
I’m writing a little mini Rails app (my first one) and I’ve been working with RSpec for other Ruby scripts I’ve been doing so far. However, in my ignorance I did not realize that rails new <app> would generate the standard Rails tests (well, duh! ;] ). So now I’d like to switch to RSpec. Here…
Language Awareness – Ruby
Something to be aware of when dealing with Ruby that the core docs don’t really document clearly enough: explicit vs. implicit conversions. Ruby provides functions like to_i and to_int that at first blush seem to do exactly the same thing. Yet, try to do something like “42”.to_i and you get back the natural-seeming 42 as…
Ruby: debugging a live process
You can attach GDB to a Ruby process and get all sorts of information. Call with gdb /path/to/ruby <PID>, then running call rb_backtrace() from within gdb will get you a stack trace and you can raise exceptions with call rb_raise(rb_eException, “Testing…”). Neat trick, see here for the original source. I should add that in Ruby…
Debugging bash functions
This one took me forever to figure out, so documenting it here in the hopes I’ll remember it now. ;] If you have a function that is sourced from a bash script, it’s hard to debug because you can’t just do the usual {bash}bash -x script.sh{/bash} thing – all that will do is run the…
What’s in a name?
So we ordered some hardwood flooring from Lumber Liquidators and were trying to get a delivery scheduled. We weren’t home during the day, of course, so the poor lady from Lumber Liquidators had to call us like 5 times (she was really trying! ;] ). Luckily she was VERY consistent in her message delivery (they…
Fighting Fantasy documentary Kickstarter
I was seriously into these books as a kid, would love to see this documentary completed. Consider contributing to this Kickstarter project if you’d like to see it realized as much as I do – hurry, the project expires on Nov 30th 2012!
git is da bomb!
OK, OK, I know, no news here, this is no revelation to anybody but myself, but I’m just so elated I’m finally getting it! ;] http://gitref.org/ really finally got me over the hump and the Git Pro book at http://git-scm.com/book/ is giving me much insight. This is mostly a “note to self” – move along,…
Parse Garmin TCX files
So I was looking at my Vibram FiveFingers Bikila LS shoes and noticed that they started to wear a fair bit on the soles. I then got curious as to how many miles I had put on them. I also have a Garmin Forerunner 305 that I wear on every run, so I figured this…
Neat find/grep trick
So for the longest time I was always bothered by the fact that I couldn’t grep for files of a particular name that were buried several levels deep. For example, if you wanted to do grep -r nifty.java.property *.properties, then unless you had a *.properties file in your current directory, grep would assume that there…