HOWTO make readline and history work with irb and rails console on OS X Yosemite

Here’s how to make readline (including control-R reverse search) and command history work with both irb and the Rails console with rbenv and OS X Yosemite (10.10.4).

You need to install Readline first, as OS X ships with libedit instead. You also need to make sure rbenv knows where you put readline.

1. Install rbenv and the ruby-build plugin.

2. Download GNU Readline. Install it:

tar zxf readline-6.3.tar.gz && rm readline-6.3.tar.gz cd readline-6.3 configure && make && sudo make install cd .. rm -rf readline-6.3

3. Install Ruby using rbenv:

RUBY_CONFIGURE_OPTS="--with-readline-dir=/usr/local" rbenv install 2.2.2

3. Add these lines to your ~/.irbrc file:

require 'irb/completion' require 'irb/ext/save-history' IRB.conf[:SAVE_HISTORY] = 10000 IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"

This gets everything working in irb. To make things work in Rails, you need to:

4. Install the rails and rb-readline gems:

gem install rails rb-readline

5. Add rb-readline to your Rails’ app’s Gemfile:

group :development, :test do gem 'rb-readline' end

and run bundle install.

fixing dlopen “no suitable image found” errors with node, sass and grunt

I ran in to this error today:

$ grunt css
Loading “sass.js” tasks…ERROR
>> Error: dlopen(/path/to/project/node_modules/grunt-sass/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node, 1): no suitable image found. Did find:
>> /path/to/project/node_modules/grunt-sass/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node: truncated mach-o error: segment __LINKEDIT extends to 1765408 which is past end of file 1765309

Running “sass:theme” (sass) task
OptionParser::InvalidOption: invalid option: –image-path=assets/img
Use –trace for backtrace.
OptionParser::InvalidOption: invalid option: –image-path=assets/img
Use –trace for backtrace.
OptionParser::InvalidOption: invalid option: –image-path=assets/img
Use –trace for backtrace.
Warning: Exited with error code 1 Use –force to continue.

Aborted due to warnings.

For those curious, this is dyld failing to open a shared library. (See man dlopen.)

I checked and the file exists:

$ file /path/to/project/node_modules/grunt-sass/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node
/path/to/project/node_modules/grunt-sass/node_modules/node-sass/vendor/darwin-x64-node-0.12/binding.node: Mach-O 64-bit bundle x86_64

Reinstalling fixed things:

$ rm -rf node_modules/grunt-sass
$ npm install
> [email protected] install /path/to/project/node_modules/grunt-sass/node_modules/node-sass
> node scripts/install.js

> [email protected] postinstall /path/to/project/node_modules/grunt-sass/node_modules/node-sass
> node scripts/build.js

`darwin-x64-node-0.12` exists; testing
Binary is fine; exiting
[email protected] node_modules/grunt-sass
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

Quick Cruz and Paul updates

Good news: Ted Cruz’s https homepage no longer 404s:

$ curl -I

HTTP/1.1 301 Moved Permanently
Server: cloudflare-nginx
Date: Wed, 15 Apr 2015 02:03:46 GMT
Content-Type: text/html
Connection: keep-alive
Set-Cookie: __cfduid=d738dec08ca404d83f8aa2b5baafa66821429063426; expires=Thu, 14-Apr-16 02:03:46 GMT; path=/;; HttpOnly
Set-Cookie: X-Mapping-fjhppofk=FDCC6397B2B0DC55E6AEB95E4FAB3D36; path=/
CF-RAY: 1d74136e3b2b076d-EWR

I noted Rand Paul is running PHP 5.5.9. That’s true, but there’s more to it. He’s actually running PHP 5.5.9-1ubuntu4.6. Since Ubuntu backports security fixes, he’s only a two months behind, not fourteen. (PHP 5.5.9-1ubuntu4.7 was released in March.)

Presidential candidate website tech, compared

Today, Hillary Clinton announced that she’s running for president. She also launched a new website.

Over the next year, political pundits will spend far too much time dissecting the horse race, scandals (real or imagined), the electoral college and more polls than you can shake a stick at. I’m doing none of that. I’m just looking at websites.

So, you want to run a country. Can you hire someone who can run a website? These days, that means all new sites, whether running the government or delivering news should be built over HTTPS.

Here’s how the (declared) candidates’ sites fare:

Site Expected
HTTPS works ish [1]
HTTPS default
Requires SNI [2]
https redirects to www 404 error works works
https works redirects to works redirects to
canonical hostname none something
SSL Labs rating A [3] A A A A+
intermediate sha2
cert vendor Comodo RapidSSL RapidSSL Comodo
intermediate cert vendor Comodo GeoTrust Global CA GeoTrust Global CA Comodo
cert type Wildcard Wildcard Wildcard SAN Wildcard or Standard
CDN Fastly CloudFlare CloudFlare CloudFlare something
Server signature nginx (
AmazonS3 (www)
CloudFlare nginx CloudFlare nginx CloudFlare nginx
Tech Python (?) [gunicorn 19.1.1 + Varnish]
groundwork [4]
WordPress 4.1.1 PHP 5.5.9
WordPress 4.1.1
Registrar Network Solutions GoDaddy Pty Ltd GoDaddy hopefully not GoDaddy
Whois Privacy Domains By Proxy, LLC Whois Privacy Services Pty Ltd Domains By Proxy, LLC
Origin IP ?? [5] ?? ??
Origin Server ?? Apache/2.2 ?? ??
Mail server Gmail Gmail Gmail Gmail
ESP (SPF) SilverPOP Systems Marketo, Sendgrid Mailgun VerveMail
robots details Disallow: /api/ Disallow: /wp-admin/ nothing disallowed [6]
Site Expected

I’ll update this as more candidates declare or sites change.


  1. works, but gives a 404 error.
  2. Sites that require Server Name Indication (SNI), such as this one, are incompatible with a handful of legacy browsers.
  3. Fastly’s gets a score of 90 on key exchange, while the AWS servers ( get a score of 80. The AWS servers also have an extra cert in the chain (signed with SHA1).
  4. Groundwork appears to be a custom JavaScript web framework. It does not seem to be related to either the I Like Robots Groundwork or Groundwork CSS.
  5. Likely origin, based on server responses.
  6. Redirects to


  • 2:01am EDT: Fixed topline.
  • 8:46am EDT: Fixed spelling of spend and fastly.
  • 11:33am EDT: (now) seems to have certs signed with SHA-1.
  • 2:27pm EDT: Added robots.txt.
  • 2:35pm EDT: Added “Expected” column.

Monte McNaughton is a homophobic bigot

“It’s not the premier of Ontario’s job — especially Kathleen Wynne — to tell parents what’s age-appropriate for their children.”
—Monte McNaughton

“What is it that especially disqualifies me for the job that I’m doing? Is it that I’m a woman? Is it that I’m a mother? Is it that I have a master’s of education? Is it that I was a school council chair? Is it that I was the minister of education? What is it exactly that the member opposition thinks disqualifies me from doing the job that I’m doing?”
Kathleen Wynne

On Feedback

Jobs’s taste for merciless criticism was notorious; Ive recalled that, years ago, after seeing colleagues crushed, he protested. Jobs replied, “Why would you be vague?,” arguing that ambiguity was a form of selfishness: “You don’t care about how they feel! You’re being vain, you want them to like you.” Ive was furious, but came to agree. “It’s really demeaning to think that, in this deep desire to be liked, you’ve compromised giving clear, unambiguous feedback,” he said.

The New Yorker


Ain’t no party like a no-party party

Sometimes indepenence isn’t enough. Want to make sure folks know you’re not a member of a political party? Here are 74 ways people have done this:

  • Do not wish to specify
  • dont have one
  • Dont have one.
  • dont know
  • dont no
  • Dont want to say
  • I am not affiliated with a party
  • I cant recall.
  • I Dont Know
  • I dont know yet
  • ideas no set party
  • Im not sure
  • Indenpendent Conservative
  • Independant/ conservative
  • Independantly Independant
  • independantly nelson
  • Independent American Party of Nevada
  • Independent democrat
  • Independent Liberal
  • Independent Moderate
  • Independent Party of America
  • IndepenDENT spell it right idiots
  • Independent voter
  • No Affiliation
  • no affiliation with any
  • No Offiliation
  • No party affiliation
  • Non Affiliated
  • non partisan
  • Non Partisen
  • non Partison
  • Non-
  • Non-Affiliate
  • non-affiliated
  • Non-partisan
  • none officially
  • nonpartisan
  • not
  • Not Affiliated
  • Not affiliated with any
  • not affilliated
  • not applicable
  • not going to say
  • Not registered for a party
  • npa
  • other
  • Prefer Not to State
  • un
  • una
  • Unaffilated
  • unaffiliat
  • Unaffiliate
  • Unaffiliated
  • Unafiliated
  • Unafilliated
  • Uncertain
  • uncommitted
  • Undeceided
  • Undecided
  • Undecited
  • Undeicded
  • Undertermined
  • Undetermined
  • undicided
  • Unenrolled
  • unknown
  • Unnafiliated
  • Unofficiated
  • Unpartisan
  • unsure anymore

Declaring independence … from the dictionary

Be careful when you give people a freeform text field. They’ll get creative. Here are 28 — yes, 28 — ways people spelled “independent”:

  • endapendent
  • Ind.
  • Indenpent
  • indepant
  • Indepdendent
  • Indepedent
  • indepenant
  • Independance
  • Independanr
  • Independence
  • Independent
  • independiant
  • independient
  • independnt
  • Indepenent
  • indepent
  • Indepentant
  • indepented
  • Indepentent
  • Indepependent
  • Indipendant
  • indipendent
  • indopenit
  • indpendant
  • Indpendent
  • Indpndt
  • undependent