Erik A. Hanson's Weblog

Installing termios gem on Mac OS X

Posted: February 3rd, 2007    Tags: Mac OS X, Ruby on Rails, Web development

When installing Capistrano, you should install the termios gem so that your password isn’t echoed when you type it.

Easier said than done

Here’s the error I got:

$sudo gem install termios
Attempting local installation of ‘termios’
Local gem file not found: termios*.gem
Attempting remote installation of ‘termios’
Updating Gem source index for: http://gems.rubyforge.org
Building native extensions. This could take a while…
can’t find header files for ruby.
ERROR: While executing gem … (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/termios-0.9.4 for inspection.
ruby extconf.rb install termios\n

It was looking for header files in /usr/lib/ruby/1.8/powerpc-darwin8.0, but they weren’t there; they were in /usr/lib/ruby/1.8/universal-darwin8.0.

The Solution

The solution was simple enough: create symlinks to the header files:

$sudo ln -s ../universal-darwin8.0/*.h ./
$sudo gem install termios


Leave a Reply



(Comments are moderated to keep out spam. Please be patient.)