参见英文答案 >
Unable to install gem – Failed to build gem native extension – cannot load such file — mkmf (LoadError)8个
嘿,我正在尝试在新的ubuntu机器上安装rails.我安装了ruby和rvm但是我收到了“未能构建gem native扩展”的错误.这是什么意思?
嘿,我正在尝试在新的ubuntu机器上安装rails.我安装了ruby和rvm但是我收到了“未能构建gem native扩展”的错误.这是什么意思?
$sudo gem install rails -v 3.2.9
(没有sudo说我没有权限)
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 `<main>' Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.0 for inspection. Results logged to /var/lib/gems/1.9.1/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
当我打字
$rails server
它说当前没有安装rails
解决方法
可能重复:
根据您的ruby版本,运行:
sudo apt-get install ruby1.9.1-dev