`require':没有要加载的文件

风格不统一 提交于 2020-08-05 23:45:15

问题:

I was trying to install rails on Ubuntu Natty Narwhal 11.04, using ruby1.9.1. 我试图使用ruby1.9.1在Ubuntu Natty Narwhal 11.04上安装rails。

I installed ruby using apt-get install ruby1.9.1-full which contains the dev package. 我使用apt-get install ruby1.9.1-full安装了ruby,其中包含dev包。 I googled the error and all have suggested I install the 1.9.1-dev which I already have. 我用Google搜索了错误,所有人都建议我安装我已经拥有的1.9.1-dev。

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

解决方案:

参考一: https://stackoom.com/question/W53G/require-没有要加载的文件-mkmf-LoadError
参考二: https://oldbug.net/q/W53G/require-no-such-file-to-load-mkmf-LoadError
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!