Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 将所有数据传输到新mac后安装gems时出错:错误:无法生成gem本机扩展_Ruby_Rubygems_Fastlane - Fatal编程技术网

Ruby 将所有数据传输到新mac后安装gems时出错:错误:无法生成gem本机扩展

Ruby 将所有数据传输到新mac后安装gems时出错:错误:无法生成gem本机扩展,ruby,rubygems,fastlane,Ruby,Rubygems,Fastlane,在设置新mac并从旧mac传输数据后,某些gems将无法安装,并且在尝试安装spidr时收到以下错误消息: $ sudo gem install spidr Password: Fetching: mini_portile2-2.4.0.gem (100%) Successfully installed mini_portile2-2.4.0 Fetching: nokogiri-1.9.0.gem (100%) Building native extensions. This could ta

在设置新mac并从旧mac传输数据后,某些gems将无法安装,并且在尝试安装spidr时收到以下错误消息:

$ sudo gem install spidr
Password:
Fetching: mini_portile2-2.4.0.gem (100%)
Successfully installed mini_portile2-2.4.0
Fetching: nokogiri-1.9.0.gem (100%)
Building native extensions. This could take a while...
ERROR:  Error installing spidr:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.9.0/ext/nokogiri
/usr/local/opt/ruby/bin/ruby -r ./siteconf20181217-24587-ul93i2.rb extconf.rb
checking if the C compiler accepts ... *** 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.

Provided configuration options:
    --with-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/local/Cellar/ruby/2.5.3_1/bin/$(RUBY_BASE_NAME)
    --help
    --clean
/usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.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/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:574:in `block in try_compile'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:521:in `with_werror'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:574:in `try_compile'
    from extconf.rb:138:in `nokogiri_try_compile'
    from extconf.rb:162:in `block in add_cflags'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:632:in `with_cflags'
    from extconf.rb:161:in `add_cflags'
    from extconf.rb:412:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/nokogiri-1.9.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.9.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/nokogiri-1.9.0/gem_make.out
$sudo gem安装spidr
密码:
获取:mini_portile2-2.4.0.gem(100%)
已成功安装mini_portile2-2.4.0
取数:nokogiri-1.9.0.gem(100%)
构建本机扩展。这可能需要一段时间。。。
错误:安装spidr时出错:
错误:无法生成gem本机扩展。
当前目录:/usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.9.0/ext/nokogiri
/usr/local/opt/ruby/bin/ruby-r./siteconf20181217-24587-ul93i2.rb extconf.rb
正在检查C编译器是否接受…***extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或标题。有关详细信息,请查看mkmf.log文件。你可以
需要配置选项。
提供的配置选项:
--使用opt dir
--选择包含
--不带opt include=${opt dir}/include
--使用opt lib
--不带opt lib=${opt dir}/lib
--用make prog
--没有make prog
--srcdir=。
--库尔迪尔
--ruby=/usr/local/ceral/ruby/2.5.3_1/bin/$(ruby_BASE_NAME)
--帮助
--干净的
/usr/local/ceral/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:456:在“try_do”中:编译器未能生成可执行文件。(运行时错误)
您必须首先安装开发工具。
from/usr/local/ceral/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:574:in'block in try_compile'
from/usr/local/ceral/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:521:in'with_werror'
from/usr/local/ceral/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:574:in'try_compile'
来自extconf.rb:138:in'nokogiri_try_compile'
来自extconf.rb:162:in`block in add_cflags'
from/usr/local/ceral/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:632:in'with_cflags'
摘自extconf.rb:161:in'addcflags'
来自extconf.rb:412:in`'
要了解此扩展未能编译的原因,请检查mkmf.log,该日志可在此处找到:
/usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/nokogiri-1.9.0/mkmf.log
extconf失败,退出代码1
Gem文件仍将安装在/usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.9.0中以供检查。
结果记录到/usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/nokogiri-1.9.0/gem_make.out
我还附上以下引用的mkmf.log文件的内容:

"clang -o conftest -I/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/x86_64-darwin18 -I/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/backward -I/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -fno-common -pipe  conftest.c  -L. -L/usr/local/Cellar/ruby/2.5.3_1/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib     -lruby.2.5.3  -lpthread -ldl -lobjc  "
In file included from conftest.c:1:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby.h:33:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/ruby.h:29:
/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/defines.h:131:11: warning: non-portable path to file '<String.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
# include <string.h>
      ^~~~~~~~~~
      <String.h>
In file included from conftest.c:1:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby.h:33:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/ruby.h:29:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/defines.h:131:
/usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found
#include <plist/Node.h>
     ^~~~~~~~~~~~~~
1 warning and 1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */
"clang-o conftest-I/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/x86_64-darwin18-I/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/ruby/backward-I/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0-I-I/usr/local/opt/libyaml/include-I/usr/local/local/opt-I/usr/local/local/opt/opt/include-I/usr/local/local/local/opt/opt/open/ssl-I/include-I/open/usr/us-D_DARWIN_UNLIMITED_SELECT-D_REENTRANT-O3-ggdb3-Wall-Wextra-Wno未使用的参数-Wno括号-Wno long-Wno缺少字段初始值设定项-Wno重言式比较-Wno括号相等-Wno常量逻辑操作数-Wno自赋值-Wunused变量-Wimplicit int-Wpointer arith-Wwrite strings-Wdeparation after语句-Wshorten-64-to-32-Wimplicit函数声明-Wdivision by zero-Wdeprecated声明-Wextra令牌-fno common-pipe conftest.c-L-L/usr/local/ceral/ruby/2.5.3_1/lib-L/usr/local/opt/libyaml/L/usr/local/opt/openssl/lib-L/usr/local/opt/readline/lib-L-fstack-protector-L/usr/local/local/libyaml-L/usr/local/opt/openssl/lib-L/usr/local/opt/readline/lib-lruby.2.5.3-lpthread-ldl-lobjc“
在conftest.c中包含的文件中:1:
在/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/ruby.h:33中包含的文件中:
在/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/ruby/ruby.h:29中包含的文件中:
/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/ruby/defines.h:131:11:警告:文件“”的非可移植路径;指定的路径与磁盘上的文件名不同[-Wnonportable include path]
#包括
^~~~~~~~~~
在conftest.c中包含的文件中:1:
在/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/ruby.h:33中包含的文件中:
在/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/ruby/ruby.h:29中包含的文件中:
在/usr/local/ceral/ruby/2.5.3_1/include/ruby-2.5.0/ruby/defines.h:131中包含的文件中:
/usr/local/include/string.h:25:10:致命错误:“未找到plist/Node.h”文件
#包括
^~~~~~~~~~~~~~
生成1个警告和1个错误。
检查的程序是:
/*开始*/
1:#包括“ruby.h”
2: 
3:int main(int argc,字符**argv)
4: {
5:返回0;
6: }
/*结束*/
我已经做了好几个小时的研究,不知道该做什么了。我在尝试安装另一个gem fastlane时附加了另一个类似的错误:

$ sudo gem install fastlane
Password:
Building native extensions. This could take a while...
ERROR:  Error installing fastlane:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.5.0/gems/unf_ext-0.0.7.5/ext/unf_ext
/usr/local/opt/ruby/bin/ruby -r ./siteconf20181217-24788-1jgurro.rb extconf.rb
checking for -lstdc++... *** 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.

Provided configuration options:
    --with-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/local/Cellar/ruby/2.5.3_1/bin/$(RUBY_BASE_NAME)
    --with-static-libstdc++
    --without-static-libstdc++
    --with-stdc++lib
    --without-stdc++lib
/usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.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/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:541:in `try_link0'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:559:in `try_link'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:778:in `try_func'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:1005:in `block in have_library'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:948:in `block in checking_for'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:350:in `block (2 levels) in postpone'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:320:in `open'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:350:in `block in postpone'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:320:in `open'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:346:in `postpone'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:947:in `checking_for'
    from /usr/local/Cellar/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:1000:in `have_library'
    from extconf.rb:6:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/unf_ext-0.0.7.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.5.0/gems/unf_ext-0.0.7.5 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/unf_ext-0.0.7.5/gem_make.out
$sudo gem安装fastlane
密码:
正在生成本机扩展。这可能需要一段时间。。。
错误:安装fastlane时出错:
错误:无法生成gem本机扩展。
当前目录:/usr/local/lib/ruby/gems/2.5.0/gems/unf_ext-0.0.7.5/ext/unf_ext
/usr/local/opt/ruby/bin/ruby-r./siteconf20181217-24788-1jgurro.rb extconf.rb
检查-lstdc++…***extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或标头。有关详细信息,请查看mkmf.log文件。您可以
需要配置选项。
提供的配置选项:
--使用opt dir
--选择包含
--不带opt include=${opt dir}/include
--使用opt lib
--不带opt lib=${opt dir}/lib
--用make prog
--没有make prog
--srcdir=。
--库尔迪尔
--ruby=/usr/local/ceral/ruby/2.5.3_1/bin/$(ruby_BASE_NAME)
--使用静态libstdc++
--无静态libstdc++
--使用stdc++lib
--没有stdc++lib
/usr/local/ceral/ruby/2.5.3_1/lib/ruby/2.5.0/mkmf.rb:456:在“try_do”中:编译器未能生成可执行文件。(运行时错误)
Y
"clang -o conftest -I/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/x86_64-darwin18 -I/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/backward -I/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -fno-common -pipe conftest.c  -L. -L/usr/local/Cellar/ruby/2.5.3_1/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib     -lruby.2.5.3  -lpthread -ldl -lobjc "
In file included from conftest.c:1:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby.h:33:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/ruby.h:29:
/usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/defines.h:131:11: warning: non-portable path to file '<String.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
# include <string.h>
          ^~~~~~~~~~
          <String.h>
In file included from conftest.c:1:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby.h:33:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/ruby.h:29:
In file included from /usr/local/Cellar/ruby/2.5.3_1/include/ruby-2.5.0/ruby/defines.h:131:
/usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found
#include <plist/Node.h>
         ^~~~~~~~~~~~~~
1 warning and 1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */