さて。

EC2上に立てたUbuntuにgemのtdをインストールした際にちょっとハマったのでメモっときます。

root@ip-10-0-0-63:~# gem install td
ERROR:  Error installing td:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:1:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/msgpack-0.4.7 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/msgpack-0.4.7/ext/gem_make.out

うん。

msgpackが足りないとな。

root@ip-10-0-0-63:~# gem install msgpack
Building native extensions.  This could take a while...
ERROR:  Error installing msgpack:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:1:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/msgpack-0.5.4 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/msgpack-0.5.4/ext/msgpack/gem_make.out

うん。

まだ何か足りないね。

色々ググってみたら、ruby1.9.1-devというパッケージが入っていないことが判明。

Unable to install gem – Failed to build gem native extension

root@ip-10-0-0-63:~# apt-get install ruby1.9.1-dev

これで解決!