Ошибка при запуске configure при установке Ruby через RVM `Компилятор C не может создавать исполняемые файлы` - PullRequest
1 голос
/ 04 апреля 2019

По какой-то причине я просто взорвал свой RVM (который работал очень хорошо) и попытался установить его снова.Я сталкиваюсь с ошибкой, которая мешает установке во время тестирования компилятором RVM.Я был бы признателен за любую помощь в отладке этого.

Проблема возникает после запуска:

$ rvm install 2.6.2

любой другой версии Ruby.

Я получаю следующий вывод

Error running './configure --prefix=/Users/andres/.rvm/rubies/ruby-

2.6.2  --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl@1.1 --disable-install-doc --enable-shared',
    please read /Users/andres/.rvm/log/1554329766_ruby-2.6.2/configure.log
    There has been an error while running configure. Halting the installation.

И файл configure.log показывает

[2019-04-04 09:07:04] ./configure
current path: /Users/andres/.rvm/src/ruby-2.6.0
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/opt/node@8/bin:/usr/local/opt/node@8/bin:/opt/local/bin:/opt/local/sbin:/Users/andres/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/node@8/bin:/opt/local/bin:/opt/local/sbin:/Users/andres/bin:/Users/andres/.rvm/bin
command(5): ./configure --prefix=/Users/andres/.rvm/rubies/ruby-2.6.0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl@1.1 --disable-install-doc --enable-shared
checking for ruby... /usr/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin18.5.0
checking host system type... x86_64-apple-darwin18.5.0
checking target system type... x86_64-apple-darwin18.5.0
checking whether the C compiler works... no
configure: error: in `/Users/andres/.rvm/src/ruby-2.6.0':
configure: error: C compiler cannot create executables
See `config.log' for more details

Соответствующие строки config.log

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2996: checking for ruby
configure:3014: found /usr/bin/ruby
configure:3027: result: /usr/bin/ruby
configure:3105: checking build system type
configure:3119: result: x86_64-apple-darwin18.5.0
configure:3207: checking host system type
configure:3220: result: x86_64-apple-darwin18.5.0
configure:3240: checking target system type
configure:3253: result: x86_64-apple-darwin18.5.0
configure:3905: checking for C compiler version
configure:3914: gcc --version >&5
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
configure:3925: $? = 0
configure:3914: gcc -v >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:3925: $? = 0
configure:3914: gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3925: $? = 1
configure:3914: gcc -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:3925: $? = 1
configure:3945: checking whether the C compiler works
configure:3967: gcc    conftest.c  >&5
ld: malformed file
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd:4:18: error: unknown enumerated scalar
platform:        zippered
                 ^~~~~~~~
 file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3971: $? = 1
configure:4009: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4014: error: in `/Users/andres/.rvm/src/ruby-2.6.0':
configure:4016: error: C compiler cannot create executables
See `config.log' for more details

Среда:

  • MacOS Mojave
  • Xcode полностью установлен с помощью инструментов CL (Версия 9.3 -9E145 -)
  • rvm 1.29.7 (последняя версия)
  • gcc -v выходы:

    Настраивается с помощью: --prefix = / Applications / Xcode.app / Contents / Developer / usr --with-gxx-include-dir = / Library / Developer / CommandLineTools / SDKs / MacOSX10.14.sdk / usr / include / c ++/4.2.1 Apple LLVM версия 9.1.0 (clang-902.0.39.1) Цель: x86_64-apple-darwin18.5.0 Модель потока: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/ bin

  • clang --version выходы:

    Apple LLVM версия 9.1.0 (clang-902.0.39.1) Цель: x86_64-apple-darwin18.5.0 Модель потока:позицияix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

    • xcode-select -p выходы: /Applications/Xcode.app/Contents/Developer

Я пытался (1) переустанавливать RVM снова и снова.(2) Запуск rvm get stable --autolibs=enable --auto-dotfiles для исправления проблем с bash и т. Д. (3) Убедитесь, что Xcode обновлен.(4) Запуск rvm install 2.6.2 --with-gcc = clang (как предлагается в некоторых ответах SO).

Все это безуспешно.Буду признателен за вашу помощь.

--- ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ ---

gem env вывод

RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.2.3
  - RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin18]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.3.0
  - USER INSTALLATION DIRECTORY: /Users/andres/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /Users/andres/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-18
  - GEM PATHS:
     - /Library/Ruby/Gems/2.3.0
     - /Users/andres/.gem/ruby/2.3.0
     - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/opt/node@8/bin
     - /usr/local/opt/node@8/bin
     - /opt/local/bin
     - /opt/local/sbin
     - /Users/andres/bin
     - /usr/local/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/opt/node@8/bin
     - /opt/local/bin
     - /opt/local/sbin
     - /Users/andres/bin
     - /Users/andres/.rvm/bin
     - /Users/andres/.rvm/bin
     - /Users/andres/.rvm/bin

1 Ответ

1 голос
/ 04 апреля 2019

Я думаю, что ваша версия xcode устарела. Обновление до 10.2 должно исправить это.

...