ruby-on-rails – 无法构建本机扩展

我在两周前切换到了Linux Mint,并希望为我的网站安装我的软件包,但我的终端给了我错误
    解决依赖关系………….
    使用rake 11.2.2
    使用i18n 0.7.0
    使用json 1.8.3
    使用minitest 5.9.0
    使用thread_safe 0.3.5
    使用构建器3.2.2
    使用erubis 2.7.0
    使用mini_portile2 2.1.0
    使用pkg-config 1.1.7
    使用机架1.6.4
    使用mime-types-data 3.2016.0521
    使用arel 6.0.3
    使用本机扩展安装debug_inspector 0.0.2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2/ext    /debug_inspector
/usr/bin/ruby2.3 -r ./siteconf20160830-6661-3kryhn.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2/ext/debug_inspector
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2/ext/debug_inspector
make "DESTDIR="
compiling debug_inspector.c
In file included from /usr/include/ruby-2.3.0/ruby/ruby.h:36:0,from debug_inspector.c:12:
/usr/include/ruby-2.3.0/ruby/defines.h:26:19: fatal error: stdio.h: No     such file or directory
compilation terminated.
Makefile:239: recipe for target 'debug_inspector.o' failed
make: *** [debug_inspector.o] Error 1

make failed,exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0   /gems/debug_inspector-0.0.2 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/debug_inspector-0.0.2/gem_make.out
Using bundler 1.11.2
Installing byebug 9.0.5 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/byebug-9.0.5/ext/byebug

/usr/bin/ruby2.3 -r ./siteconf20160830-6661-18ytmbw.rb extconf.rb
    创建Makefile

current directory: /var/lib/gems/2.3.0/gems/byebug-9.0.5/ext/byebug
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/byebug-9.0.5/ext/byebug
make "DESTDIR="
compiling breakpoint.c
In file included from /usr/include/ruby-2.3.0/ruby/ruby.h:36:0,from /usr/include/ruby-2.3.0/ruby.h:33,from byebug.h:4,from breakpoint.c:1:
/usr/include/ruby-2.3.0/ruby/defines.h:26:19: fatal error: stdio.h: No   such file or directory
compilation terminated.
Makefile:239: recipe for target 'breakpoint.o' failed
make: *** [breakpoint.o] Error 1

make failed,exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/byebug-9.0.5 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/byebug-9.0.5/gem_make.out
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using sass 3.4.22
Using tilt 2.0.5
Using spring 1.7.2
Installing sqlite3 1.3.11 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/sqlite3-1.3.11/ext/sqlite3

/usr/bin/ruby2.3 -r ./siteconf20160830-6661-3zztze.rb extconf.rb
    检查sqlite3.h … * extconf.rb失败*
    由于某些原因无法创建Makefile,可能缺少必要的
    库和/或标题.检查mkmf.log文件以获取更多详细信息.你可以
    需要配置选项.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.3
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp'
from /usr/lib/ruby/2.3.0/mkmf.rb:1144:in `block in find_header'
from /usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /usr/lib/ruby/2.3.0/mkmf.rb:1143:in `find_header'
from extconf.rb:30:in `

/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/mkmf.log
    extconf失败,退出代码1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/sqlite3-1.3.11 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem_make.out
Using turbolinks-source 5.0.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Installing nokogiri 1.6.8 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri

/usr/bin/ruby2.3 -r ./siteconf20160830-6661-657qsw.rb extconf.rb
    使用pkg-config 1.1.7版
    检查C编译器是否接受… * extconf.rb失败*
    由于某些原因无法创建Makefile,可能缺少必要的
    库和/或标题.检查mkmf.log文件以获取更多详细信息.你可以
    需要配置选项.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.3
--help
--clean
/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to    generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile'
from /usr/lib/ruby/2.3.0/mkmf.rb:522:in `with_werror'
from /usr/lib/ruby/2.3.0/mkmf.rb:571:in `try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from /usr/lib/ruby/2.3.0/mkmf.rb:629:in `with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:414:in `

/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log

extconf failed,exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/nokogiri-1.6.8 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
Using rack-test 0.6.3
Using mime-types 3.1
An error occurred while installing debug_inspector (0.0.2),and Bundler cannot
continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
bundling.

我尝试像这样安装debug_inspector
    gem install debug_inspector -v 0.0.2
结果:
    构建原生扩展.这可能需要一段时间……
    错误:安装debug_inspector时出错:
    错误:无法构建gem原生扩展.

current directory: /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2/ext/     \debug_inspector
/usr/bin/ruby2.3 -r ./siteconf20160830-6775-1iui5kl.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2/ext  /debug_inspector
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2/ext/debug_inspector
make "DESTDIR="
compiling debug_inspector.c
In file included from /usr/include/ruby-2.3.0/ruby/ruby.h:36:0,from debug_inspector.c:12:
/usr/include/ruby-2.3.0/ruby/defines.h:26:19: fatal error: stdio.h: No such   file or directory
compilation terminated.
Makefile:239: recipe for target 'debug_inspector.o' failed
make: *** [debug_inspector.o] Error 1

make failed,exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/debug_inspector-0.0.2 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/debug_inspector-0.0.2/gem_make.out

编辑
json以相同的错误运行
将尝试重新安装整个ruby系统
EDIT2
安装devkit并再次尝试

最佳答案
以下代码修复了我的问题

sudo apt-get install build-essential patch

sudo apt-get install ruby-dev zlib1g-dev liblzma-dev

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、信号(signal)、消息队列、共享内存、信号量、套接字(socket)。管道用于具有亲缘关系的进程间通信,有名管道的每个管道具有名字,使没有亲缘关系的进程间也可以通信。信号是比较复杂的通信方式,用于通知接受进程有某种事件发生,除
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别对整个系统的性能做统计,而进程级别则具体到进程,为每个进程维护统计信息。

按实现原理分,可分为基于计数器和跟踪以及剖析。含义如下:

计数器:内核维护的统计数据,通常为无符号整型,用于对发生的事件计数,比如,网络包接收计数器,磁
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书验证,详细追踪整个交互过程,可用于调用网络后端接口,诊断http和https网络服务故障。
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满、fd泄漏等问题。命令包括ping、fping、tcpdump、lsof、netstat、/proc/$pid/fd、du、grep、traceroute、dig。
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的进程数目,用uptime查看到负载很高,既有可能是CPU利用率高,也可能是大量在等待io的进程导致,用mpstat查看每个CPU的使用情况,查看CPU的使用率或者CPU花在等待io的时间,接着用pidstat定位具体的进程
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线程切换及中断切换,进程切换的开销较大,除了需要保存寄存器和程序计数器中的值还需保存全局变量、栈等到内存中,以便下次运行恢复,而同一进程中的线程切换开销会小很多,只需更新寄存器和线程独有的栈,共享资源如打开的文件、全局变量等无需切换,当硬件中
1.top命令 作用:该命令可以按CPU使用.内存使用和执行时间对任务进行排序,常用来监控系统中占用CPU或内存较高的程序及CPU和内存的负载。 默认视图: 当想看系统负载时,可观察汇总的%CPU中的us用户进程和sy系统进程是否占用CPU很高,相加接近100%就说明占用很高了,有些程序可能得不到及
文章浏览阅读1.8k次,点赞63次,收藏54次。Linux下的目录权限!!!粘滞位!!!超详解!!!
文章浏览阅读1.6k次,点赞44次,收藏38次。关于Qt的安装、Windows、Linux、MacBook_mack book 安装qt
本文介绍了使用shell脚本编写一个 Hello
文章浏览阅读1.5k次,点赞37次,收藏43次。【Linux】初识Linux——了解操作系统的发展历史以及初次体验Linux编程环境
文章浏览阅读3k次,点赞34次,收藏156次。Linux超详细笔记,个人学习时很认真的记录的,觉得好的麻烦点个赞。
文章浏览阅读6.8k次,点赞109次,收藏114次。【Linux】 OpenSSH_9.3p1 升级到 OpenSSH_9.5p1(亲测无问题,建议收藏)_openssh_9.5p1
文章浏览阅读3.5k次,点赞93次,收藏78次。初识Linux中的线程,理解线程的各种概念,理解进程地址空间中的页表转换,介绍pthread线程库并理解线程库!
文章浏览阅读863次。出现此问题为Linux文件权限问题,解决方案为回到引擎目录执行命令。输入用户密码后运行./UnrealEditor。_increasing per-process limit of core file size to infinity.
文章浏览阅读2.9k次。使用文本编辑器:打开CSV文件,并使用文本编辑器(如Notepad++、Sublime Text、Visual Studio Code等)来查看文件的字符编码格式。通常在编辑器的底部状态栏或设置中可以找到当前编码的显示。请注意,上述方法并非绝对准确,特别是当文件没有明确的编码标识时。因此,如果你发现CSV文件在不同的工具或方法中显示不同的编码格式,可能需要进行进一步的分析和判断,或者尝试使用不同的编码转换方法。该命令将输出文件的MIME类型和编码信息。使用命令行工具:在命令行中,你可以使用。_shell读取csv文件逐行处理
本文介绍了如何在Linux系统中升级gcc版本,以便更好地支持C++11及以上版本的新特性。通过升级gcc,可以提升编译器的功能和性能,获得更好的开发体验。详细的步骤和方法请参考原文链接。
文章浏览阅读4.4k次,点赞6次,收藏19次。Mosquitto是一个开源的MQTT消息代理服务器。MQTT是一个轻量级的、基于发布/订阅模式的消息传输协议。 mosquitto的安装使用比较简单,可以方便的来进行一些测试。_linux mosquitto
文章浏览阅读7.2k次,点赞2次,收藏12次。Linux中,用于根目录下有一个.ssh目录,保存了ssh相关的key和一些记录文件。_~/.ssh/
文章浏览阅读4.5k次,点赞5次,收藏18次。首先需要安装 snmp ,使用下面的命令进行安装安装完毕之后,使用下面的命令查看是否安装成功当命令行显示如图即为安装成功。_snmp工具