gpt4 book ai didi

ruby-on-rails - `require' : no such file to load -- mkmf (LoadError)

转载 作者:太空宇宙 更新时间:2023-11-03 16:39:23 25 4
gpt4 key购买 nike

我尝试使用 ruby​​1.9.1 在 Ubuntu Natty Narwhal 11.04 上安装 Rails。

我使用包含开发包的 apt-get install ruby​​1.9.1-full 安装了 ruby​​。我用谷歌搜索了这个错误,所有人都建议我安装我已经拥有的 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 包,而不仅仅是 ruby1.8。所以如果你有 ruby1.9.1

sudo apt-get install ruby1.9.1-dev

或安装通用的 ruby​​ 版本,使用(根据@lamplightdev 评论):

sudo apt-get install ruby-dev

应该修复它。

尝试定位 mkmf 以查看该文件是否确实存在。

关于ruby-on-rails - `require' : no such file to load -- mkmf (LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7645918/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com