Ruby Ubuntu install rails failed_ Error installing rails_Failed to build gem native e

laofo · 2013年02月26日 · 19 次阅读

Ubuntu install rails failed_ Error installing rails_Failed to build gem native extension

scm@test:~/a$ sudo gem install rails ...... Fetching: mail-2.4.4.gem (100%) Fetching: actionmailer-3.2.12.gem (100%) Fetching: rake-10.0.3.gem (100%) Fetching: rack-ssl-1.3.3.gem (100%) Fetching: thor-0.17.0.gem (100%) Fetching: json-1.7.7.gem (100%) 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/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'

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

scm@test:~/a$

mkmf is part of the ruby1.9.1-dev package. This package contains the header files needed for extension libraries for Ruby 1.9.1. You need to install the ruby1.9.1-dev package by doing:

Then you can install Rails as per normal

需要 登录 后方可回复。