Ubuntu の root 以外のアカウントで rails を入れようとするとエラーになる
下記のエラーが出る。
Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:53:in `require': cannot load such file -- mkmf (LoadError) from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:53:in `require' from extconf.rb:13:in `<main>' Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/atomic-1.1.14 for inspection. Results logged to /usr/lib/ruby/gems/1.9.1/gems/atomic-1.1.14/ext/gem_make.out
下記を実行すると良いみたいだけど、RVM で Ruby 入れてるので、apt-get で Ruby の何かを入れたくない感じはある。
sudo apt-get install ruby-dev
root であれば問題ないので、ユーザーに依存する何かが原因になっているのかな。Linux のユーザーについて理解を深めないと解決できないかもしれない。