Ошибка при установке драгоценных камней после переноса всех данных на новый Mac: ОШИБКА: не удалось создать собственное расширение для гемов

После настройки нового Mac и переноса данных со старого некоторые драгоценные камни не устанавливаются, и при попытке установить 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

Я также прилагаю содержимое указанного ниже файла 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 */

Я проводил исследования уже несколько часов и больше не знаю, что делать. Прилагаю еще одну похожую ошибку при попытке установить другой гем, 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

Соответствующее содержимое 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 */

Инструменты разработчика Xcode устанавливаются с помощью xcode-select --install.

Может у кого-нибудь есть подсказка, что делать?

Заранее большое спасибо за любую помощь и с наилучшими пожеланиями Себастьян

Вы открыли Xcode и приняли лицензию? Это одноразовая вещь, которую нужно сделать при новых установках.

Tom 17.12.2018 19:21

Как вы установили Ruby? Если ответ будет либо «Я не использовал, я использую системный Ruby», либо «Я использовал brew», значит, вы делаете это неправильно. Используйте RVM.

anothermh 17.12.2018 20:25

@Tom Да, лицензия принимается через командную строку sudo xcodebuild - лицензия

leschirmeur 17.12.2018 21:41

@anothermh, используя варево. Заглянем в RVM

leschirmeur 17.12.2018 21:42

Еще одна мысль: первый камень терпит неудачу на нокогири. Мне удалось запустить brew install libiconv и brew install libyaml, чтобы исправить проблемы nokogiri.

Tom 17.12.2018 21:51

@anothermh, используя варево. Посмотрим на RVM ... хм, при попытке установить RVM я получаю аналогичное сообщение об ошибке, установка не завершается. Я думаю, это важная часть: компиляция dln_find.c В файле, включенном из dln_find.c: 37: В файле, включенном из /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.‌ platform / Developer / S‌ DKs /MacOSX10.14.sdk/‌ usr / include / strings.‌ h: 92: /usr/local/include/string.h:25:10: фатальная ошибка: файл 'plist / Node.h' не найден # include <plist / Node.h> ^ ~~~~~~~~~~~~ Возникла 1 ошибка.

leschirmeur 17.12.2018 21:59

Как ни странно, в /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.‌ platform / Developer / S‌ DKs / MacOSX10.14.sdk / ‌ usr / include / strings.‌ h: 92 следующее: написано: #include <string.h> В той же папке есть файл string.h, но кажется, что каким-то образом имеется ссылка на файл String.h (с большой буквы S) в папке / usr / local / include /. В этом файле в строке 25 указано #include <plist / Node.h>, который не может быть найден.

leschirmeur 17.12.2018 22:09

Думаю, я исправил это, удалив файл String.h в папке / usr / local / include /. То же самое написано в этом вопросе SO: stackoverflow.com/questions/49314732/… Однако я только что удалил один файл, а не все те, которые были показаны доктором пивоварения.

leschirmeur 17.12.2018 22:15

Вы тоже brew install gcc? это похоже на другую зависимость.

Jay Dorsey 18.12.2018 01:06
Пошаговое руководство по созданию собственного Slackbot: От установки до развертывания
Пошаговое руководство по созданию собственного Slackbot: От установки до развертывания
Шаг 1: Создание приложения Slack Чтобы создать Slackbot, вам необходимо создать приложение Slack. Войдите в свою учетную запись Slack и перейдите на...
1
9
1 467
1

Ответы 1

Думаю, я исправил это, удалив файл String.h в папке / usr / local / include /. То же самое написано в этом вопросе SO: gem install libxml-ruby: фатальная ошибка: файл plist / Node.h не найден

Команда brew doctor сообщила мне, что в папке / usr / local / include / есть много файлов, которые можно удалить. Я удалил файл String.h и оставил все остальные файлы на месте. Это исправило это.

Спасибо за все комментарии и попытки помочь.

Другие вопросы по теме