OK, I’m at the end of my tether with this. There are a few similar questions but they all refer to therubyracer 0.10, and they mostly conclude that the problem can be fixed by u
I had this same problem when I upgraded from OSX Mountain Lion to OSX Mavericks. The patch level of ruby 1.8.7 apparently matters.
Upgrading from ruby-1.8.7-p354 to ruby-1.8.7-375 did the trick for me.
libv8 (3.16.14.3-x86_64-darwin-13) and the therubyracer (0.12.0) gems installed without problem.
assuming you use rbenv:
rbenv versions
system
* 1.8.7-p354
2.0.0-rc2
rbenv uninstall 1.8.7-p354
rbenv install 1.8.7-p375
rbenv versions
system
* 1.8.7-p375
2.0.0-rc2
bundle install