我发誓,我已经看到了关于在 stackoverflow 上安装 Ruby 的所有讨论......没有任何帮助。我安装了 Xcode 4.1 以及 rvm 1.16.19。
libksba 已安装。
以某种方式安装了一些 Ruby 版本,但我不知道哪个版本——因为如果我执行任何类型的 Ruby 命令——“ruby”本身,“ruby --version”,无论如何,我没有得到响应,并且得到一个提示,我必须按 ctrl/c。
无论是否使用 RVM,每当我尝试安装任何版本的 Ruby 时,都会得到以下输出:
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/Dauber/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286', please read /Users/Dauber/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
ruby-1.9.3-p286 is not installed.
以下是上述 configure.log 的输出:
[2012-11-08 20:46:41] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/Dauber/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
现在,一个奇怪的事情是系统中没有名为“config.log”的文件,所以我无法“看到”它“了解更多详细信息”。
另一件奇怪的事情......我在这台机器上使用 gcc 和 gcc-4.2 编译了几十个 C 程序——我又试了一次,它们工作正常,所以我不知道到底是什么交易......
我尝试从https://github.com/kennethreitz/osx-gcc-installer安装无济于事;它完全没有区别。
这一切都在我运行 OSX 10.7.5 的 MacBook 上。奇怪的是……我在运行完全相同版本的 Lion 的 iMac 上遇到了零问题……事实上,我什至不需要安装 Ruby——它恰好已经安装了 1.9.2;我只需要添加 Rails 并且一切都运行良好......到底有什么不同,以至于我无法让这些东西在我的 MacBook 上运行???
在 PRUSSWAN 的链接之后:长话短说,另一篇 prusswan 链接的帖子提到 Rails 安装程序中存在错误,需要更改 /etc/rvmrc。我进行了更改,但在尝试安装 ruby 时收到了与以前完全相同的错误消息。不过,这就是 configure.log 现在所说的:
[2012-11-08 22:42:08] env LDFLAGS=-L/opt/sm/pkg/active/lib -L/Users/Dauber/.rvm/usr/lib CFLAGS=-I/opt/sm/pkg/active/include -I/Users/Dauber/.rvm/usr/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286
current path: /Users/Dauber/.rvm/src/ruby-1.9.3-p286
command(8): env LDFLAGS=-L/opt/sm/pkg/active/lib -L/Users/Dauber/.rvm/usr/lib CFLAGS=-I/opt/sm/pkg/active/include -I/Users/Dauber/.rvm/usr/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.2 accepts -g... yes
checking for gcc-4.2 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.2 accepts -g... yes
checking how to run the C preprocessor... gcc-4.2 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc-4.2 needs -traditional... no
checking whether the linker is GNU ld... no
checking whether gcc-4.2 -E accepts -o... yes
checking for real target cpu... x86_64
checking for ranlib... ranlib
checking for ar... ar
checking for as... as
checking for objdump... no
checking for gobjdump... no
checking for objcopy... no
checking for gobjcopy... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... -d
use 'mkdir -p' as MKDIR_P
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking for AIX... no
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether -Wno-unused-parameter is accepted... yes
checking whether -Wno-parentheses is accepted... yes
checking whether -Wno-long-long is accepted... yes
checking whether -Wno-missing-field-initializers is accepted... yes
checking whether -Werror=pointer-arith is accepted... yes
checking whether -Werror=write-strings is accepted... yes
checking whether -Werror=declaration-after-statement is accepted... yes
checking whether -Werror=shorten-64-to-32 is accepted... yes
checking whether -Werror=implicit-function-declaration is accepted... yes
checking whether -Wall -Wextra is accepted... yes
checking whether -ggdb is accepted... yes
checking whether -fvisibility=hidden is accepted... yes
checking whether -Wl,-unexported_symbol,_Init_* is accepted... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... no
checking for inline... inline
checking for working volatile... yes
checking for long long... yes
checking for off_t... yes
checking char bit... ./configure: line 8508: syntax error near unexpected token `rb_cv_char_bit,'
./configure: line 8508: ` AC_COMPUTE_INT(rb_cv_char_bit, CHAR_BIT,'
所以看起来生成的 ./configure 文件带有拼写错误或其他东西......