我发誓,我已经看到所有关于在stackoverflow上安装Ruby的讨论......没有任何帮助。我安装了Xcode 4.1以及rvm 1.16.19。不能为我的生活在Mac OSX上安装Ruby 10.7.5
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无济于事;它完全没有区别。
这是在我的MacBook上运行OSX 10.7.5。奇怪的是...我的iMac运行完全相同版本的Lion的ZERO问题...实际上,我甚至不需要安装Ruby - 它恰好已经有1.9.2;我只需要添加Rails和所有完美工作...什么是如此不同,我无法得到这个东西在我的MacBook上工作?长话短说,其他post prusswan提到,Rails安装程序中存在一个错误,需要修改/ etc/rvmrc。我进行了更改,但在尝试安装红宝石时遇到了与以前完全相同的错误消息。这就是现在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文件生成一个错字或东西...
它会告诉你阅读 “/Users/Dauber/.rvm/log/ruby-1.9.3-p286/configure.log”,是吗?至少在这里发布。 –
安德鲁 - 刚刚添加它。 – ScatteredFrog
尝试使用Ruby 1.9.3-p194代替('rvm use 1.9.3-p194')。 p286最近才出现,所以可能会出现打嗝。另一种可能是升级你的xcode版本 – prusswan