`require':没有要加载的文件-mkmf(LoadError) [英] `require': no such file to load -- mkmf (LoadError)

查看:105
本文介绍了`require':没有要加载的文件-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

或安装通用红宝石版本,请使用(根据@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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆