gpt4 book ai didi

ruby-on-rails - Gem::Ext::BuildError: 错误:无法为 rails 版本 4.2.6 构建 gem native 扩展

转载 作者:数据小太阳 更新时间:2023-10-29 07:02:01 26 4
gpt4 key购买 nike

我创建了新的 Rails 应用程序并尝试运行 bundle install 它显示了这个错误,

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator/usr/bin/ruby2.3 -r ./siteconf20170704-11395-12tpg5u.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.3.0/gems/json-1.8.6 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/json-1.8.6/gem_make.out

An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling

请给我一些建议,在此先感谢。

最佳答案

如果您有 Mac 或 Linux 机器,请尝试以下命令:

sudo apt-get install ruby-dev

如果失败了,你的输出是什么:

gem install json -v '1.8.6'

(请复制并粘贴所有输出)。

Similar issue

我不确定如何为 Mac 修复它,但人们对 brew install ruby​​ 有积极的体验。

关于ruby-on-rails - Gem::Ext::BuildError: 错误:无法为 rails 版本 4.2.6 构建 gem native 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44901379/

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