`require': 没有要加载的文件 -- mkmf (LoadError) [英] `require': no such file to load -- mkmf (LoadError)
问题描述
我正在尝试使用 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
或安装通用 ruby 版本,使用(根据@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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!