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

时间:2012-11-09 03:05:18

标签: ruby macos osx-lion

我发誓,我已经看到了在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安装无效;它完全没有区别。

这一切都在我的MacBook上,运行OSX 10.7.5。奇怪的是......我的iMac运行完全相同版本的Lion时出现了ZERO问题......事实上,我甚至不需要安装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文件会生成拼写错误或其他内容......

2 个答案:

答案 0 :(得分:0)

关注this guide,其中介绍了如何使用RVM设置Ruby。

答案 1 :(得分:0)

哇......我无法相信,但我找到了自己问题的答案,而且非常糟糕。

我应该使用“rvm remove”命令 - 尝试过,突然就像魔术一样,我现在可以安装任何和所有版本的Ruby了。

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

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