使用rvm安装Ruby时出错(Mac OSX Yosemite)

时间:2015-01-20 20:34:13

标签: ruby-on-rails ruby macos rvm osx-yosemite

我是Ruby的新手。 我尝试使用rvm安装Ruby,它会抛出错误。 我首先尝试使用以下命令。

rvm install ruby-1.9.3-p392

我收到以下错误。

    Harsha-Bhats-MacBook-Pro:src harshabhat$ rvm install ruby-1.9.3-p392
ruby-1.9.3-p392 - #removing src/ruby-1.9.3-p392..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: found user selected compiler 'gcc', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/harshabhat/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
ruby-1.9.3-p392 - #extracting ruby-1.9.3-p392 to /Users/harshabhat/.rvm/src/ruby-1.9.3-p392....
ruby-1.9.3-p392 - #applying patch /Users/harshabhat/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p392 - #configuring..............................................
ruby-1.9.3-p392 - #post-configuration.
ruby-1.9.3-p392 - #compiling.....................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/harshabhat/.rvm/log/1421785532_ruby-1.9.3-p392/make.log
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
st.c:520:35: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            i = table->num_entries++;
              ~ ~~~~~~~~~~~~~~~~~~^~
1 error generated.
make: *** [st.o] Error 1
++ return 2
There has been an error while running make. Halting the installation.

然后安装了apple gcc 4.2编译器并得到以下错误。

Harsha-Bhats-MacBook-Pro:src harshabhat$ rvm install ruby-1.9.3-p392 --with-gcc=gcc-apple-4.2
ruby-1.9.3-p392 - #removing src/ruby-1.9.3-p392..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: found user selected compiler 'gcc-apple-4.2', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/harshabhat/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
ruby-1.9.3-p392 - #extracting ruby-1.9.3-p392 to /Users/harshabhat/.rvm/src/ruby-1.9.3-p392....
ruby-1.9.3-p392 - #applying patch /Users/harshabhat/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p392 - #configuring..............................................
ruby-1.9.3-p392 - #post-configuration.
ruby-1.9.3-p392 - #compiling.....................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/harshabhat/.rvm/log/1421785714_ruby-1.9.3-p392/make.log
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
st.c:520:35: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            i = table->num_entries++;
              ~ ~~~~~~~~~~~~~~~~~~^~
1 error generated.
make: *** [st.o] Error 1
++ return 2
There has been an error while running make. Halting the installation.

然后尝试使用clang编译器(安装了XCode命令行开发工具)

Harsha-Bhats-MacBook-Pro:src harshabhat$ rvm install ruby-1.9.3-p392 --with-gcc=clang
ruby-1.9.3-p392 - #removing src/ruby-1.9.3-p392..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: found user selected compiler 'clang', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/harshabhat/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
ruby-1.9.3-p392 - #extracting ruby-1.9.3-p392 to /Users/harshabhat/.rvm/src/ruby-1.9.3-p392....
ruby-1.9.3-p392 - #applying patch /Users/harshabhat/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p392 - #configuring..............................................
ruby-1.9.3-p392 - #post-configuration.
ruby-1.9.3-p392 - #compiling.....................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/harshabhat/.rvm/log/1421785882_ruby-1.9.3-p392/make.log
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
st.c:520:35: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            i = table->num_entries++;
              ~ ~~~~~~~~~~~~~~~~~~^~
1 error generated.
make: *** [st.o] Error 1
++ return 2
There has been an error while running make. Halting the installation.

有人可以帮我解决这个问题吗?尝试了在线提供的所有问题,对于大多数问题,上述3个解决方案中的一个解决了这些问题。不适合我。 请帮助我。

0 个答案:

没有答案