gpt4 book ai didi

ruby-on-rails - 在 rails 上安装 ruby​​ 时出错,无法构建 gem native 扩展

转载 作者:太空宇宙 更新时间:2023-11-04 09:30:53 25 4
gpt4 key购买 nike

尝试在我的 linux mint 中安装 rails 时出现以下错误:

sudo gem install rails
Fetching: activesupport-4.2.3.gem (100%)
Successfully installed activesupport-4.2.3
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

/usr/bin/ruby2.2 -r ./siteconf20150718-15613-1wed0b4.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /var/lib/gems/2.2.0/extensions/x86_64-linux/2.2.0/nokogiri-1.6.6.2/gem_make.out

这是我的 ruby 版本:

shafaet@shafaet-HP-ProBook ~ $ ruby -version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux-gnu]
-e:1:in `<main>': undefined local variable or method `rsion' for main:Object (NameError)

任何帮助将不胜感激,谢谢。

最佳答案

我相信没有安装 ruby​​ 开发环境。需要开发环境来编译 ruby​​ 扩展。您可以运行以下命令:

sudo apt-get install ruby2.2-dev # as you're using the 2.2 version

关于ruby-on-rails - 在 rails 上安装 ruby​​ 时出错,无法构建 gem native 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31488917/

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