新手问题 bundle install 时报错 # 缺了东西?

winse · 2016年12月24日 · 最后由 winse 回复于 2016年12月24日 · 2499 次阅读

各种 google、bing,就是没找到解决方法,所以来求助各位了

操作系统:ubuntu 16.04 ruby 环境:2.3.3p222 [x86_64-linux] 报错信息:

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

    current directory: /home/winse/.rvm/gems/ruby-2.3.3/gems/ffi-1.9.14/ext/ffi_c
/home/winse/.rvm/rubies/ruby-2.3.3/bin/ruby -r ./siteconf20161224-5954-jxwijc.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.


/home/winse/.rvm/rubies/ruby-2.3.3/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 /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
    from /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
    from /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:657:in `try_ldflags'
    from /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:1813:in `pkg_config'
    from extconf.rb:15:in `<main>'

log:

"pkg-config --exists libffi"
| pkg-config --libs libffi
=> "-lffi\n"
"gcc -o conftest -I/home/winse/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/x86_64-linux -I/home/winse/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/ruby/backward -I/home/winse/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0 -I.     -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wno-maybe-uninitialized  -fPIC conftest.c  -L. -L/home/winse/.rvm/rubies/ruby-2.3.3/lib -Wl,-R/home/winse/.rvm/rubies/ruby-2.3.3/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/winse/.rvm/rubies/ruby-2.3.3/lib -L/home/winse/.rvm/rubies/ruby-2.3.3/lib -lruby  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

#1 楼 @chenge winse@winse-pc:~/development/rails/winse_rails$ sudo aptitude install ruby-dev 下列“新”软件包将被安装。
fonts-lato{a} javascript-common{a} libjs-jquery{a} libruby2.3{a} rake{a} ruby{a} ruby-dev ruby-did-you-mean{a} ruby-minitest{a} ruby-net-telnet{a} ruby-power-assert{a} ruby-test-unit{a} ruby2.3{a} ruby2.3-dev{a} rubygems-integration{a} 0 个软件包被升级,新安装 15 个,0 个将被删除,同时 403 个将不升级。 需要获取 0 B 的存档。解包后将要使用 32.3 MB。 您要继续吗?[Y/n/?] y E: 没有源可以用来下载 3.4+nmu1ubuntu2 版本的 ttf-mscorefonts-installer:amd64 E: 没有源可以用来下载 3.4+nmu1ubuntu2 版本的 ttf-mscorefonts-installer:amd64 E: 内部错误:无法生成下载软件包列表

没源。。。。

#2 楼 @winse 自己搜索下吧,锻炼下。还有,大段代码要格式化,这个是约定俗成。

#3 楼 @chenge 😆 感谢!终于搞定了

winse 关闭了讨论。 12月24日 18:50
需要 登录 后方可回复, 如果你还没有账号请 注册新账号