I'm trying to install the Middleman gem on a completely generic installation of Ubuntu Trusty (i386). Here's my console input/output:
vagrant@vagrant-ubuntu-trusty-32:~/rj$ which ruby /usr/bin/ruby vagrant@vagrant-ubuntu-trusty-32:~/rj$ ruby -v ruby 1.9.3p484 (2013-11-22 revision 43786) [i686-linux] vagrant@vagrant-ubuntu-trusty-32:~/rj$ gem install middleman Fetching: bundler-1.7.7.gem (100%) ERROR: While executing gem ... (Errno::EACCES) Permission denied - /var/lib/gems
As you can see, I'm using a Vagrant VM after getting similar errors on my host system. (Another answer to someone else's previous question had pointed me toward both Vagrant and Docker, each of which has given output like the lines above.) Interestingly, even using
sudo gem install middleman gives me problems.
(I thought about pasting that output here, and I still might if someone asks, but to be honest, I'd rather avoid installing external gems as root if possible, preferring to focus on the errors above. The whole point of middleman, after all, is to create a defined set of flat outputs, limiting the need for privileges and customizations.)
Has anyone encountered errors like this before?
EDIT: By request, here's the output when I use
sudo gem install middleman:
Fetching: bundler-1.7.7.gem (100%) Fetching: rack-1.5.2.gem (100%) Fetching: tilt-1.4.1.gem (100%) Fetching: erubis-2.7.0.gem (100%) Fetching: uber-0.0.11.gem (100%) Fetching: hooks-0.4.0.gem (100%) Fetching: rack-test-0.6.2.gem (100%) Fetching: thor-0.19.1.gem (100%) Fetching: i18n-0.6.11.gem (100%) Fetching: json-1.8.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing middleman: 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/json-1.8.1 for inspection. Results logged to /var/lib/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out