繁体   English   中英

不能为我的生命在Mac OSX 10.7.5安装Ruby

[英]Cannot for the life of me install Ruby on Mac OSX 10.7.5

我发誓,我已经看到了在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程序-我刚刚尝试了AGAIN并且它们工作正常,所以我不知道到底要做什么。

我试图从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文件会产生拼写错误或其他内容。

遵循本指南 ,其中涵盖了如何使用RVM设置Ruby。

哇...我简直不敢相信,但是我找到了自己的问题的答案,而且非常DUH。

我本应该使用“ rvm remove”命令进行尝试的,然后突然间像魔术一样,我现在可以将所有版本的Ruby安装到我的心中。

现在来看Aptana是否可以让我创建一个新的Rails项目。 :)

感谢您的反馈,所有...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM