【问题标题】:Why can't RVM install Ruby 2.0.0?为什么 RVM 不能安装 Ruby 2.0.0?
【发布时间】:2013-07-14 23:49:30
【问题描述】:

我正在尝试通过rvm install 2.0.0 安装新版本的 Ruby 2.0.0。

安装失败并出现以下错误:

Error running 'requirements_osx_port_install_port',
please read /Users/can/.rvm/log/ruby-1.9.3-p448/1373845387_port_install.log

这是日志文件:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 16033    0 16033    0     0   6478      0 --:--:--  0:00:02 --:--:--  7091
100 51766    0 51766    0     0  18820      0 --:--:--  0:00:02 --:--:-- 20404
mkdir: /Users/can/.rvm/src/MacPorts-2.1.3: File exists
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  0  825k    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  7  825k    7 65536    0     0  25599      0  0:00:33  0:00:02  0:00:31 27899
 30  825k   30  256k    0     0  73029      0  0:00:11  0:00:03  0:00:08 77603
 56  825k   56  464k    0     0   101k      0  0:00:08  0:00:04  0:00:04  106k
 81  825k   81  672k    0     0   120k      0  0:00:06  0:00:05  0:00:01  162k
100  825k  100  825k    0     0   135k      0  0:00:06  0:00:06 --:--:--  185k
checking build system type... x86_64-apple-darwin12.4.0
checking host system type... x86_64-apple-darwin12.4.0
checking target system type... x86_64-apple-darwin12.4.0
checking MacPorts version... 2.1.3
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... /usr/bin/xcode-select
checking Mac OS X version... 10.8.4
checking Xcode location... /Applications/Xcode5-DP.app/Contents/Developer
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether we are using the GNU Objective C compiler... yes
checking whether gcc accepts -g... yes
checking for bsdmake... no
checking for pmake... no
checking for bzip2... /usr/bin/bzip2
checking for bzr... no
checking for chown... /usr/sbin/chown
checking for cp... /bin/cp
checking for cpio... /usr/bin/cpio
checking for cvs... /usr/bin/cvs
checking for diff... /usr/bin/diff
checking for dscl... /usr/bin/dscl
checking for dseditgroup... /usr/sbin/dseditgroup
checking for file... /usr/bin/file
checking for git... /usr/bin/git
checking for gnumake... /usr/bin/gnumake
checking for gnupatch... no
checking for gpatch... no
checking for gnutar... /usr/bin/gnutar
checking for gzip... /usr/bin/gzip
checking for hdiutil... /usr/bin/hdiutil
checking for hg... no
checking for launchctl... /bin/launchctl
checking for lipo... /usr/bin/lipo
checking for lsbom... /usr/bin/lsbom
checking for lzma... no
checking for make... /usr/bin/make
checking for mdfind... /usr/bin/mdfind
checking for mdls... /usr/bin/mdls
checking for mkbom... /usr/bin/mkbom
checking for mtree... /usr/sbin/mtree
checking for open... /usr/bin/open
checking for openssl... /usr/bin/openssl
checking for patch... /usr/bin/patch
checking for pax... /bin/pax
checking for rmdir... /bin/rmdir
checking for rsync... /usr/bin/rsync
checking for sed... /usr/bin/sed
checking for svn... /usr/bin/svn
checking for swig... no
checking for tar... /usr/bin/tar
checking for unzip... /usr/bin/unzip
checking for xar... /usr/bin/xar
checking for xcodebuild... /usr/bin/xcodebuild
checking for xcrun... /usr/bin/xcrun
checking for xz... no
checking for zip... /usr/bin/zip
checking for launchd... yes
checking for sed... (cached) /usr/bin/sed
checking which sed flag to use for extended regexp... -E (BSD)
checking for tar... (cached) /usr/bin/tar
checking whether tar supports -q... yes (bsdtar)
checking for tar... (cached) /usr/bin/tar
checking for gnutar... (cached) /usr/bin/gnutar
checking for which tar variant to use... /usr/bin/gnutar
checking for /usr/bin/gnutar --no-same-owner support... yes
checking for patch... (cached) /usr/bin/patch
checking for gpatch... no
checking for GNU (FSF) patch... /usr/bin/patch
checking how to mark unused variables... 
checking for gcc symbol visibility attribute... __attribute__((visibility("hidden")))
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking how to run the Objective C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking objc/objc.h usability... yes
checking objc/objc.h presence... yes
checking for objc/objc.h... yes
checking if linking libobjc requires pthreads... no
checking for Apple Objective-C runtime... yes
checking for GNU Objective C runtime... no
configure: Using Apple Objective-C runtime
checking for Apple Foundation library... yes
configure: WARNING: GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library
configure: Using Apple Foundation library
checking for CoreFoundation framework... yes
checking for SystemConfiguration framework... yes
checking for IOKit framework... yes
checking for CFNotificationCenterGetDarwinNotifyCenter... yes
checking for whether we will build daemondo... yes
checking for ports tree... configure: WARNING: No ports tree found
checking for MacPorts config directory... ${sysconfdir}/macports
checking for install user... root
checking for install group... admin
checking for macports user... macports
checking what permissions to use for installation directories... 0755
checking for Applications installation directory... /Applications/MacPorts
checking for Frameworks installation directory... /opt/local/Library/Frameworks
checking for Universal CPU architectures... x86_64 i386
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for sys/wait.h that is POSIX.1 compatible... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking crt_externs.h usability... yes
checking crt_externs.h presence... yes
checking for crt_externs.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/fcntl.h usability... yes
checking sys/fcntl.h presence... yes
checking for sys/fcntl.h... yes
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/sysctl.h usability... yes
checking sys/sysctl.h presence... yes
checking for sys/sysctl.h... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/paths.h usability... yes
checking sys/paths.h presence... yes
checking for sys/paths.h... yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking for bzero... yes
checking for memset... yes
checking for fgetln... yes
checking for lockf... yes
checking for flock... yes
checking for setmode... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for strlcpy... yes
checking for copyfile... yes
checking for clearenv... no
checking for sysctlbyname... yes
checking if readlink conforms to POSIX 1003.1a... yes
checking CommonCrypto/CommonDigest.h usability... yes
checking CommonCrypto/CommonDigest.h presence... yes
checking for CommonCrypto/CommonDigest.h... yes
checking for Tcl configuration... found /usr/lib/tclConfig.sh
checking for existence of /usr/lib/tclConfig.sh... loading
checking for Tcl public headers... /usr/include
checking for tclsh... /usr/bin/tclsh
checking for Tcl package directory... /Library/Tcl
checking whether tclsh was compiled with threads... yes
checking for curl-config... /usr/bin/curl-config
checking sqlite3.h usability... yes
checking sqlite3.h presence... yes
checking for sqlite3.h... yes
checking sqlite3ext.h usability... yes
checking sqlite3ext.h presence... yes
checking for sqlite3ext.h... yes
checking for Tcl sqlite3 location... /usr/lib/sqlite3
checking for SQLite >= 3003011... yes
checking for Tcl Thread package... yes
checking how to build libraries... shared
checking that any existing MacPorts install can be upgraded... yes
configure: creating ./config.status
config.status: creating src/programs/daemondo/Makefile
config.status: creating Doxyfile
config.status: creating Makefile
config.status: creating Mk/macports.autoconf.mk
config.status: creating doc/base.mtree
config.status: creating doc/prefix.mtree
config.status: creating doc/macosx.mtree
config.status: creating doc/macports.conf
config.status: creating doc/pubkeys.conf
config.status: creating portmgr/freebsd/Makefile
config.status: creating src/Makefile
config.status: creating src/machista1.0/Makefile
config.status: creating src/macports1.0/macports_autoconf.tcl
config.status: creating src/port1.0/port_autoconf.tcl
config.status: creating src/registry2.0/registry_autoconf.tcl
config.status: creating src/programs/Makefile
config.status: creating src/macports1.0/macports_fastload.tcl
config.status: creating setupenv.bash
config.status: creating src/pkg_mkindex.sh
config.status: creating src/config.h
config.status: src/config.h is unchanged
===> making all in doc
/bin/sh: make: No such file or directory
make: *** [all] Error 1

我该怎么办?

更新:

我已经卸载了 Xcode 5 Developer Preview 3,只需将其扔进垃圾箱并清空即可。

现在我得到一个不同的日志:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0
100 32009    0 32009    0     0   4545      0 --:--:--  0:00:07 --:--:--  5162
100 51766    0 51766    0     0   7113      0 --:--:--  0:00:07 --:--:--  8044
mkdir: /Users/can/.rvm/src/MacPorts-2.1.3: File exists
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  3  825k    3 32768    0     0  11994      0  0:01:10  0:00:02  0:01:08 13704
 21  825k   21  176k    0     0  48143      0  0:00:17  0:00:03  0:00:14 52975
 40  825k   40  336k    0     0  72379      0  0:00:11  0:00:04  0:00:07 77983
 61  825k   61  512k    0     0  91401      0  0:00:09  0:00:05  0:00:04 97180
 87  825k   87  720k    0     0   106k      0  0:00:07  0:00:06  0:00:01  146k
100  825k  100  825k    0     0   116k      0  0:00:07  0:00:07 --:--:--  182k
checking build system type... x86_64-apple-darwin12.4.0
checking host system type... x86_64-apple-darwin12.4.0
checking target system type... x86_64-apple-darwin12.4.0
checking MacPorts version... 2.1.3
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... /usr/bin/xcode-select
checking Mac OS X version... 10.8.4
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 4.6.3
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/can/.rvm/src/MacPorts-2.1.3':
configure: error: C compiler cannot create executables
See `config.log' for more details

很明显 GCC 无法定位。

当我输入 gcc -v 时,我得到以下信息:

Configured with: --prefix=/Applications/Xcode5-DP.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
xcrun: Error: could not stat active Xcode path '/Applications/Xcode5-DP.app/Contents/Developer'. (No such file or directory)

Xcode 4 已使用命令行工具正确安装。我应该怎么做才能让系统看到 Xcode 4 的 GCC?

【问题讨论】:

  • rvm info 的输出附加到您的问题中。听起来 RVM 很困惑,或者您的路径不对。
  • 你必须更新 rvm,我在尝试使用旧 rvm 安装 ruby​​ 2.0 时遇到了类似的问题。所以更新 rvm 然后你就可以安装 ruby​​ 2.0了。

标签: ruby rvm failed-installation


【解决方案1】:

这可能无关,但您似乎正在使用 Xcode 5 => checking Xcode location... /Applications/Xcode5-DP.app/Contents/Developer 这尚未发布的开发/测试版本,很可能只应与 OSX 10.9 一起使用 - 这也是预发布。

卸载新的 Xcode 和命令行工具,并通过下载正确/发布版本的 Xcode(大约 4.6.3)重新开始 - 您还需要从 Xcode 再次安装命令行工具。


编辑 1

这里是描述how to switch default used Xcode (provided by Can Sürmeli)的链接

【讨论】:

  • 我认为你可能是对的。请检查我对原始问题的更新。
  • 它仍然使用较新的命令行工具,检查命令行工具应用程序并删除它的所有副本 - 然后安装可用于您的系统的 CLT(不是任何测试版)。
  • 借助本页 (cocoanetics.com/2012/07/…) 上的知识,我轻松地更改了终端看到的 Xcode 的 CLT 版本。之后,RVM 程序顺利完成。
  • 另外,非常感谢您为我指明了正确的方向。非常感谢:)
【解决方案2】:

如果你在 OSX 上,你需要安装 XCode,如果你认为它已经安装,那么它可能已经损坏,所以重新安装。

如果你没有它,你可以安装 XCode 的命令行工具

https://developer.apple.com/downloads

最新版本是“Xcode 的命令行工具 (OS X Mountain Lion) - 2013 年 4 月”

【讨论】:

  • 根据配置输出 XCode 已安装:checking for xcode-select... /usr/bin/xcode-select,gcc 也是如此,编译器也可以工作。
  • @the Tin Man,从 XCode 4.3 开始,默认不安装命令行工具
【解决方案3】:

也许这个问题有点明显,但对好的答案很重要。

/bin/sh: make: 没有这样的文件或目录

错误信息说没有找到 make 命令。是安装你的电脑吗?

【讨论】:

  • 配置说它找到了 make:checking for make... /usr/bin/make。然后/bin/sh 说不能。听起来像是 PATH 问题。
【解决方案4】:

我认为您缺少 make 和一些依赖项。

  1. 运行rvm implode。这将让您通过完全删除从 RVM 获得的任何内容重新开始。确保您删除了 .rvm 目录,例如 /Users/can/.rvm/
  2. 安装make
  3. 安装bash curl git patch
  4. 然后安装 Ruby 依赖项:

    osx-gcc-installer libksba openssl libreadline git zlib1g libyaml libsqlite3 sqlite3 libxml2 libxslt autoconf libc6 libgdbm ncurses automake libtool bison pkg-config
    
  5. 安装openjdk ant

  6. 最后,用 Ruby 安装 RVM:

    \curl -L https://get.rvm.io | bash -s stable --ruby
    

【讨论】:

  • 这可能是正确的答案,尽管 configure 能够找到 XCode 和 make。听起来 RVM 很混乱,没有传递正确的参数或正确设置路径。
  • 日志来自配置 - 它自身失败
猜你喜欢
  • 2013-07-11
  • 2013-03-09
  • 2023-04-03
  • 2013-03-09
  • 1970-01-01
  • 1970-01-01
  • 2013-07-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多