Ruby rbenv安装1.9.3-p429生成失败

Ruby rbenv安装1.9.3-p429生成失败,ruby,rbenv,Ruby,Rbenv,我正在尝试安装ruby 1.9.3-p429,但不断出现编译错误。我向商店周围的几个人寻求帮助,但没有人能找到答案。我能够安装ruby 2.0.0,没有任何错误 以下是我在输入命令rbenv install ruby-1.9.3-p429 以下是我收到的全部错误消息: Installing ruby-1.9.3-p429... BUILD FAILED Inspect or clean up the working tree at /var/folders/64/sclwxt551_5b50

我正在尝试安装ruby 1.9.3-p429,但不断出现编译错误。我向商店周围的几个人寻求帮助,但没有人能找到答案。我能够安装ruby 2.0.0,没有任何错误

以下是我在输入命令
rbenv install ruby-1.9.3-p429

以下是我收到的全部错误消息:

Installing ruby-1.9.3-p429...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/64/sclwxt551_5b50b9m0s1j6z00000gn/T/ruby-build.20130521144442.70391
Results logged to /var/folders/64/sclwxt551_5b50b9m0s1j6z00000gn/T/ruby-build.20130521144442.70391.log

Last 10 log lines:
x ruby-1.9.3-p429/golf_prelude.c
/var/folders/64/sclwxt551_5b50b9m0s1j6z00000gn/T/ruby-build.20130521144442.70391/ruby-1.9.3-p429 /var/folders/64/sclwxt551_5b50b9m0s1j6z00000gn/T/ruby-build.20130521144442.70391 ~/Desktop
checking build system type... x86_64-apple-darwin12.3.0
checking host system type... x86_64-apple-darwin12.3.0
checking target system type... x86_64-apple-darwin12.3.0
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/var/folders/64/sclwxt551_5b50b9m0s1j6z00000gn/T/ruby-build.20130521144442.70391/ruby-1.9.3-p429':
configure: error: C compiler cannot create executables
See `config.log' for more details
这是直接从
config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

$ ./configure --prefix=/Users/thomasberry/.rbenv/versions/1.9.3-p429

## --------- ##
## Platform. ##
## --------- ##

hostname = Thomass-MacBook-Pro.local
uname -m = x86_64
uname -r = 12.3.0
uname -s = Darwin
uname -v = Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.
4 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3
Primary memory available: 4.00 gigabytes
Default processor set: 134 tasks, 682 threads, 4 processors
Load average: 1.40, Mach factor: 2.80
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/thomasberry/.rbenv/libexec
PATH: /Users/thomasberry/.rbenv/plugins/ruby-build/bin
PATH: /Users/thomasberry/.rbenv/bin
PATH: /Users/thomasberry/.rbenv/shims
PATH: /Users/thomasberry/.rbenv/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin


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

configure:2798: checking build system type
configure:2812: result: x86_64-apple-darwin12.3.0
configure:2880: checking host system type
configure:2893: result: x86_64-apple-darwin12.3.0
configure:2913: checking target system type
configure:2926: result: x86_64-apple-darwin12.3.0
configure:3407: checking for C compiler version
configure:3416: /usr/bin/gcc --version >&5
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3427: $? = 0
configure:3416: /usr/bin/gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
configure:3427: $? = 0
configure:3416: /usr/bin/gcc -V >&5
llvm-gcc-4.2: argument to `-V' is missing
configure:3427: $? = 1
configure:3416: /usr/bin/gcc -qversion >&5
i686-apple-darwin11-llvm-gcc-4.2: no input files
configure:3427: $? = 1
configure:3447: checking whether the C compiler works
configure:3469: /usr/bin/gcc  -O3 -Wno-error=shorten-64-to-32 -march=native -O3 -I'/Users/thomasberry/.rbenv/versions/1.9.3-p429/include'  -L'/Users/thomasberry/.rbenv/versions/1.9.3-p429/lib'  conftest.c  >&5
conftest.c:1: error: bad value (native) for -march= switch
conftest.c:1: error: bad value (native) for -mtune= switch
configure:3473: $? = 1
configure:3511: 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 ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3516: error: in `/var/folders/64/sclwxt551_5b50b9m0s1j6z00000gn/T/ruby-build.20130522093258.3452/ruby-1.9.3-p429':
configure:3518: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-apple-darwin12.3.0
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=/usr/bin/gcc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=' -O3 -Wno-error=shorten-64-to-32 -march=native -O3'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-I'\''/Users/thomasberry/.rbenv/versions/1.9.3-p429/include'\'' '
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-L'\''/Users/thomasberry/.rbenv/versions/1.9.3-p429/lib'\'' '
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-apple-darwin12.3.0
ac_cv_prog_CC=/usr/bin/gcc
ac_cv_target=x86_64-apple-darwin12.3.0

## ----------------- ##
## Output variables. ##
## ----------------- ##

ALLOCA=''
AR=''
ARCHFILE=''
ARCH_FLAG=''
AS=''
ASFLAGS=''
BASERUBY='ruby'
BUILTIN_ENCOBJS=''
BUILTIN_TRANSOBJS=''
BUILTIN_TRANSSRCS=''
CAPITARGET=''
CC='/usr/bin/gcc'
CCDLFLAGS=''
CFLAGS=' -O3 -Wno-error=shorten-64-to-32 -march=native -O3'
CHDIR=''
COMMON_HEADERS=''
COMMON_LIBS=''
COMMON_MACROS=''
COUTFLAG=''
CP=''
CPP=''
CPPFLAGS='-I'\''/Users/thomasberry/.rbenv/versions/1.9.3-p429/include'\'' '
CPPOUTFILE=''
CXX=''
CXXFLAGS=''
DEFS=''
DLDFLAGS=''
DLDLIBS=''
DLEXT2=''
DLEXT=''
DLLWRAP=''
DOT=''
DOXYGEN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ENABLE_SHARED=''
EXECUTABLE_EXTS=''
EXEEXT=''
EXPORT_PREFIX=''
EXTDLDFLAGS=''
EXTOUT=''
EXTSTATIC=''
GCC=''
GNU_LD=''
GREP=''
INSTALLDOC=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LDFLAGS='-L'\''/Users/thomasberry/.rbenv/versions/1.9.3-p429/lib'\'' '
LDSHARED=''
LDSHAREDXX=''
LIBEXT=''
LIBOBJS=''
LIBPATHENV=''
LIBPATHFLAG=''
LIBRUBY=''
LIBRUBYARG=''
LIBRUBYARG_SHARED=''
LIBRUBYARG_STATIC=''
LIBRUBY_A=''
LIBRUBY_ALIASES=''
LIBRUBY_DLDFLAGS=''
LIBRUBY_LDSHARED=''
LIBRUBY_RELATIVE=''
LIBRUBY_SO=''
LIBS=''
LINK_SO=''
LN_S=''
LTLIBOBJS=''
MAINLIBS=''
MAJOR='1'
MAKEDIRS=''
MAKEFILES=''
MANTYPE=''
MINIOBJS=''
MINIRUBY=''
MINOR='9'
MKDIR_P=''
NM=''
NROFF=''
NULLCMD=''
OBJCOPY=''
OBJDUMP=''
OBJEXT=''
OUTFLAG=''
PACKAGE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PKG_CONFIG=''
PLATFORM_DIR=''
PREP=''
RANLIB=''
RDOCTARGET=''
RI_BASE_NAME=''
RM=''
RMALL=''
RMDIR=''
RMDIRS=''
RPATHFLAG=''
RUBYW_BASE_NAME='rubyw'
RUBYW_INSTALL_NAME=''
RUBY_BASE_NAME='ruby'
RUBY_INSTALL_NAME=''
RUBY_PROGRAM_VERSION='1.9.3'
RUBY_RELEASE_DATE='2013-05-15'
RUBY_SO_NAME=''
RUNRUBY=''
SET_MAKE=''
SHELL='/bin/sh'
SOLIBS=''
STATIC=''
STRIP=''
SYMBOL_PREFIX=''
TEENY='1'
TEST_RUNNABLE=''
THREAD_MODEL=''
TRY_LINK=''
UNIVERSAL_ARCHNAMES=''
UNIVERSAL_INTS=''
USE_RUBYGEMS=''
WERRORFLAG=''
WINDRES=''
XCFLAGS=''
XLDFLAGS=''
XRUBY=''
XRUBY_LIBDIR=''
XRUBY_RUBYHDRDIR=''
XRUBY_RUBYLIBDIR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_OBJCOPY=''
ac_ct_OBJDUMP=''
arch=''
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin12.3.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin12.3.0'
build_vendor='apple'
cflags=''
configure_args=''
cppflags=''
cxxflags=' ${optflags} ${debugflags} ${warnflags}'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
debugflags=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec=''
exec_prefix='NONE'
host='x86_64-apple-darwin12.3.0'
host_alias=''
host_cpu='x86_64'
host_os='darwin12.3.0'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
optflags=''
pdfdir='${docdir}'
prefix='/Users/thomasberry/.rbenv/versions/1.9.3-p429'
program_transform_name='s&^&&'
psdir='${docdir}'
ridir=''
ruby_pc=''
ruby_version=''
rubyhdrdir=''
rubylibprefix=''
rubyw_install_name=''
sbindir='${exec_prefix}/sbin'
setup=''
sharedstatedir='${prefix}/com'
sitearch=''
sitedir=''
sitehdrdir=''
sysconfdir='${prefix}/etc'
target='x86_64-apple-darwin12.3.0'
target_alias=''
target_cpu='x86_64'
target_os='darwin12.3.0'
target_vendor='apple'
try_header=''
vendordir=''
vendorhdrdir=''
warnflags=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define CANONICALIZATION_FOR_MATHN 1

configure: exit 77

尝试安装g++然后
rbenv安装ruby-1.9.3-p429

此外,如果没有边界,请尝试
rvm


我仍然不确定为什么
rbenv
显示此错误

尝试安装g++然后
rbenv安装ruby-1.9.3-p429

此外,如果没有边界,请尝试
rvm


我仍然不确定为什么
rbenv
显示此错误

我也有此问题

在我的例子中,我尝试使用
RUBY\u CFLAGS
变量,该变量警告它不完全安全


尝试并失败后,我从
~/.bash\u profile
中删除了相应的行,但再次失败。原因是变量仍然是在当前的bash环境中定义的,所以我必须
取消RUBY\u CFLAGS
才能安装RUBY版本。

我也遇到了这个问题

在我的例子中,我尝试使用
RUBY\u CFLAGS
变量,该变量警告它不完全安全


尝试并失败后,我从
~/.bash\u profile
中删除了相应的行,但再次失败。原因是变量仍然是在当前的bash环境中定义的,因此我必须
取消RUBY\u CFLAGS
才能安装RUBY版本。

发生此问题是因为您的系统中没有安装gcc。 您所要做的就是打开Xcode->转到顶部菜单上的首选项->选择下载选项卡->在该窗口中安装命令行工具

现在重新启动终端并重试

rvm install 1.9.3

发生此问题是因为您的系统中未安装gcc。 您所要做的就是打开Xcode->转到顶部菜单上的首选项->选择下载选项卡->在该窗口中安装命令行工具

现在重新启动终端并重试

rvm install 1.9.3

安装正确版本的
gcc

由于苹果为gcc提供了一些令人费解的废话,在Mac上可能会更加棘手

我使用
brew remove gcc
brew remove gcc49
(使用
brew search gcc
查找安装内容)一次一次删除了所有gcc安装。然后再次运行rbenv安装,得到了一条为像我这样的傻瓜编写的清晰消息

(0)kashyap@vpn-client-163$ rbenv install 1.8.7-p352 --verbose

ERROR: This package must be compiled with GCC, but ruby-build couldn'tfind a suitable `gcc` executable on your system. Please install GCC
and try again.

DETAILS: Apple no longer includes the official GCC compiler with Xcode
as of version 4.2. Instead, the `gcc` executable is a symlink to
`llvm-gcc`, a modified version of GCC which outputs LLVM bytecode.

For most programs the `llvm-gcc` compiler works fine. However,
versions of Ruby older than 1.9.3-p125 are incompatible with
`llvm-gcc`. To build older versions of Ruby you must have the official
GCC compiler installed on your system.

TO FIX THE PROBLEM: Install Homebrew's apple-gcc42 package with this
command: brew tap homebrew/dupes ; brew install apple-gcc42

You will need to install the official GCC compiler to build older
versions of Ruby even if you have installed Apple's Command Line Tools
for Xcode package. The Command Line Tools for Xcode package only
includes `llvm-gcc`.

BUILD FAILED (OS X 10.11.2 using ruby-build 20151216)


(1)kashyap@vpn-client-163$
按照指示去做,瞧

(0)kashyap@vpn-客户端163$brew tap自制/复制;
==>点击自制/复制
克隆到“/usr/local/Library/Taps/homebrew/homebrew dups”。。。
远程:计数对象:41,完成。
远程:压缩对象:100%(41/41),完成。
远程:总计41(增量0),重复使用5(增量0),包重复使用0
拆包对象:100%(41/41),完成。
正在检查连接。。。完成。
攻丝38个公式(101个文件,412K)
(0)kashyap@vpn-客户机-163$
(0)kashyap@vpn-客户机-163$
(0)kashyap@vpn-客户机-163$
(0)kashyap@vpn-client-163$brew安装apple-gcc42
==>从自制/复制软件安装apple-gcc42
==>下载http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
######################################################################## 100.0%
==>/bin/pax--unsecure-rz-f usr.pkg/Payload-s、/usr、/usr/local/ceral/apple-gcc42/4.2.1-5666.3、,
==>注意事项
注:
此公式提供了在4.2版本中从XCode中删除的组件
释放。如果您使用的是
4.2之前的XCode版本。
此公式包含从苹果的GCC源代码build构建的编译器
5666.3,可从以下网址获得:
http://opensource.apple.com/tarballs/gcc
所有编译器都有一个`-4.2`后缀。还包括一个GFortran编译器。
==>摘要

安装正确版本的
gcc

由于苹果为gcc提供了一些令人费解的废话,在Mac上可能会更加棘手

我使用
brew remove gcc
brew remove gcc49
(使用
brew search gcc
查找安装内容)一次一次删除了所有gcc安装。然后再次运行rbenv安装,得到了一条为像我这样的傻瓜编写的清晰消息

(0)kashyap@vpn-client-163$ rbenv install 1.8.7-p352 --verbose

ERROR: This package must be compiled with GCC, but ruby-build couldn'tfind a suitable `gcc` executable on your system. Please install GCC
and try again.

DETAILS: Apple no longer includes the official GCC compiler with Xcode
as of version 4.2. Instead, the `gcc` executable is a symlink to
`llvm-gcc`, a modified version of GCC which outputs LLVM bytecode.

For most programs the `llvm-gcc` compiler works fine. However,
versions of Ruby older than 1.9.3-p125 are incompatible with
`llvm-gcc`. To build older versions of Ruby you must have the official
GCC compiler installed on your system.

TO FIX THE PROBLEM: Install Homebrew's apple-gcc42 package with this
command: brew tap homebrew/dupes ; brew install apple-gcc42

You will need to install the official GCC compiler to build older
versions of Ruby even if you have installed Apple's Command Line Tools
for Xcode package. The Command Line Tools for Xcode package only
includes `llvm-gcc`.

BUILD FAILED (OS X 10.11.2 using ruby-build 20151216)


(1)kashyap@vpn-client-163$
按照指示去做,瞧

(0)kashyap@vpn-客户端163$brew tap自制/复制;
==>点击自制/复制
克隆到“/usr/local/Library/Taps/homebrew/homebrew dups”。。。
远程:计数对象:41,完成。
远程:压缩对象:100%(41/41),完成。
远程:总计41(增量0),重复使用5(增量0),包重复使用0
拆包对象:100%(41/41),完成。
正在检查连接。。。完成。
攻丝38个公式(101个文件,412K)
(0)kashyap@vpn-客户机-163$
(0)kashyap@vpn-客户机-163$
(0)kashyap@vpn-客户机-163$
(0)kashyap@vpn-client-163$brew安装apple-gcc42
==>从自制/复制软件安装apple-gcc42
==>下载http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
######################################################################## 100.0%
==>/bin/pax--unsecure-rz-f usr.pkg/Payload-s、/usr、/usr/local/ceral/apple-gcc42/4.2.1-5666.3、,
==>注意事项
注:
此公式提供了在4.2版本中从XCode中删除的组件
释放。如果您使用的是
4.2之前的XCode版本。
此公式包含从苹果的GCC源代码build构建的编译器
5666.3,可从以下网址获得:
http://opensource.apple.com/tarballs/gcc
所有编译器都有一个`-4.2`后缀。还包括一个GFortran编译器。
==>摘要

我从几年前开始使用rbenv,以前从未遇到过这个问题。。。但是今天我在LinuxMint安装程序中遇到了错误

我的解决方案就是安装一些软件包