hogepiyoエンジニアリング

トラブルシューティングからノウハウ、作ってみた系まで扱う情報系ブログ

knife-soloをUbuntuにインストールする

基本的にドットインストールの動画通りだけど、chef-soloのインストールで詰まったのでメモ.

まず、chefを https://learnchef.opscode.com/quickstart/workstation-setup/#linux を参考にインストールする

$sudo gem install knife-solo
Fetching: mixlib-config-1.1.2.gem (100%)
Fetching: mixlib-cli-1.3.0.gem (100%)
Fetching: mixlib-log-1.6.0.gem (100%)
Fetching: mixlib-authentication-1.3.0.gem (100%)
Fetching: mixlib-shellout-1.2.0.gem (100%)
Fetching: systemu-2.5.2.gem (100%)
Fetching: yajl-ruby-1.1.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing knife-solo:
        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 suc                      h 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/yajl-ruby-1.1.0 for                       inspection.
Results logged to /var/lib/gems/1.9.1/gems/yajl-ruby-1.1.0/ext/yajl/gem_make.ou                      t

あ?
requireされているmkmfがないらしい。

$ sudo apt-get install make
$ sudo gem install knife-solo
Building native extensions.  This could take a while...

省略

Installing RDoc documentation for knife-solo-0.2.0...
$ knife -v
Chef: 11.6.0

入ったぽい。めでたし。