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

ruby-on-rails– 无法构建本机扩展,第1张

概述我在两周前切换到了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    使

我在两周前切换到了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.rbcreating Makefilecurrent directory: /var/lib/gems/2.3.0/gems/deBUG_inspector-0.0.2/ext/deBUG_inspectormake "DESTDIR=" cleancurrent directory: /var/lib/gems/2.3.0/gems/deBUG_inspector-0.0.2/ext/deBUG_inspectormake "DESTDIR="compiling deBUG_inspector.cIn 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 directorycompilation terminated.Makefile:239: recipe for target 'deBUG_inspector.o' Failedmake: *** [deBUG_inspector.o] Error 1make Failed,exit code 2Gem 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.outUsing bundler 1.11.2Installing byeBUG 9.0.5 with native extensionsGem::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/byeBUGmake "DESTDIR=" cleancurrent directory: /var/lib/gems/2.3.0/gems/byeBUG-9.0.5/ext/byeBUGmake "DESTDIR="compiling breakpoint.cIn 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 directorycompilation terminated.Makefile:239: recipe for target 'breakpoint.o' Failedmake: *** [breakpoint.o] Error 1make Failed,exit code 2Gem 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.outUsing coffee-script-source 1.10.0Using execJs 2.7.0Using thor 0.19.1Using concurrent-ruby 1.0.2Using multi_Json 1.12.1Using sass 3.4.22Using tilt 2.0.5Using spring 1.7.2Installing sqlite3 1.3.11 with native extensionsGem::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.outUsing turbolinks-source 5.0.0Using rdoc 4.2.2Using tzinfo 1.2.2Installing nokogiri 1.6.8 with native extensionsGem::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 1Gem 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.outUsing rack-test 0.6.3Using mime-types 3.1An error occurred while installing deBUG_inspector (0.0.2),and Bundler cannotcontinue.Make sure that `gem install deBUG_inspector -v '0.0.2'` succeeds beforebundling.

我尝试像这样安装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.rbcreating Makefilecurrent directory: /var/lib/gems/2.3.0/gems/deBUG_inspector-0.0.2/ext  /deBUG_inspectormake "DESTDIR=" cleancurrent directory: /var/lib/gems/2.3.0/gems/deBUG_inspector-0.0.2/ext/deBUG_inspectormake "DESTDIR="compiling deBUG_inspector.cIn 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 directorycompilation terminated.Makefile:239: recipe for target 'deBUG_inspector.o' Failedmake: *** [deBUG_inspector.o] Error 1make Failed,exit code 2Gem 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 patchsudo apt-get install ruby-dev zlib1g-dev liblzma-dev
总结

以上是内存溢出为你收集整理的ruby-on-rails – 无法构建本机扩展全部内容,希望文章能够帮你解决ruby-on-rails – 无法构建本机扩展所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1046596.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)