问题描述
我试图使用ruby1.9.1.在Ubuntu Natty Narwhal 11.04上安装Rails.
I was trying to install rails on Ubuntu Natty Narwhal 11.04, using ruby1.9.1.
我使用包含开发包的apt-get install ruby1.9.1-full
安装了ruby.我在错误中进行了搜索,所有建议我都安装我已经拥有的1.9.1-dev.
I installed ruby using apt-get install ruby1.9.1-full
which contains the dev package. I googled the error and all have suggested I install the 1.9.1-dev which I already have.
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:36:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:36
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
推荐答案
在寻找解决方案后,发现需要-dev
软件包,而不仅仅是ruby1.8
.因此,如果您有ruby1.9.1
在做
After some search for a solution it turns out the -dev
package is needed, not just ruby1.8
. So if you have ruby1.9.1
doing
sudo apt-get install ruby1.9.1-dev
或安装通用红宝石版本,请使用(根据@lamplightdev注释):
or to install generic ruby version, use (as per @lamplightdev comment):
sudo apt-get install ruby-dev
应该修复它.
尝试locate mkmf
来查看文件是否确实存在.
Try locate mkmf
to see if the file is actually there.
这篇关于`require':没有要加载的文件-mkmf(LoadError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!