问题

我试图安装rails在Ubuntu Natty Narwhal 11.04,使用ruby1.9.1.

我使用 apt-get install ruby​​1.9.1-full 安装了ruby,它包含了dev包.我googled的错误,所有建议我安装我已经有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


解决方法

在一些搜索解决方案后,结果是需要 -dev 包,而不仅仅是 ruby​​1.8 .所以如果你有 ruby​​1.9.1

sudo apt-get install ruby1.9.1-dev

或安装通用ruby版本,使用(根据@lamplightdev注释):

sudo apt-get install ruby-dev

应该修复它.

尝试找到mkmf 以查看该文件是否确实存在.




相关问题推荐