gpt4 book ai didi

ruby-on-rails - 无法安装 Rails。错误 : Error installing rails: ERROR: Failed to build gem native extension

转载 作者:太空宇宙 更新时间:2023-11-04 11:42:48 24 4
gpt4 key购买 nike

我尝试安装rails

sudo gem install rails

但是我有错误:

Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.5/ext/nokogiri
/usr/bin/ruby2.5 -I /usr/local/lib/site_ruby/2.5.0 -r ./siteconf20191108-7794-8cwt0o.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.5.0/gems/nokogiri-1.10.5 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.5/gem_make.out

我的操作系统是 Linux。我该如何修复错误?

更新。我设法把 rails 4 版本,但他们不能更新。

最佳答案

尝试安装

sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev libxml2-dev libxslt1-dev

Nokogiri 需要编译,因此需要一些 C 定义才能工作。

关于ruby-on-rails - 无法安装 Rails。错误 : Error installing rails: ERROR: Failed to build gem native extension,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58767090/

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