plamoni / SiriProxy

A (tampering) proxy server for Apple's Siri
GNU General Public License v3.0
2.12k stars 343 forks source link

Ruby Installation Error #436

Closed sturma closed 11 years ago

sturma commented 11 years ago

While installing ruby on Mac Mountain Lion, I get the following error:

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p385.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/alex/.rvm/archives
Extracting yaml to /Users/alex/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/alex/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/alex/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/alex/.rvm/usr
Installing Ruby from source to: /Users/alex/.rvm/rubies/ruby-1.9.3-p385, this may take a while depending on your cpu(s)...
ruby-1.9.3-p385 - #downloading ruby-1.9.3-p385, this may take a while depending on your connection...
ruby-1.9.3-p385 - #extracted to /Users/alex/.rvm/src/ruby-1.9.3-p385 (already extracted)
ruby-1.9.3-p385 - #configuring
ruby-1.9.3-p385 - #compiling
Error running 'make', please read /Users/alex/.rvm/log/ruby-1.9.3-p385/make.log
There has been an error while running make. Halting the installation.

Looking at the make.log file:

[2013-02-07 19:58:28] make
    CC = clang
    LD = ld
    LDSHARED = clang -dynamic -bundle
    CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration  -pipe 
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/alex/.rvm/usr/include -I. -I.ext/include/x86_64-darwin12.1.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  
    SOLIBS = 
compiling regparse.c
regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    return t->num_entries;
    ~~~~~~ ~~~^~~~~~~~~~~
1 error generated.
make: *** [regparse.o] Error 1

I have installed latest Xcode 4, and also tried the workaround of issue #168; no success.

sturma commented 11 years ago

ok, solved!

nesv commented 11 years ago

I came across this issue while searching because I was experiencing the exact same issue while using rvm to install ruby-1.9.3-p385.

You do not need to uninstall Xcode. If you have Xcode installed, and you are using Homebrew, you can just do the following:

$ brew tap homebrew/dupes
$ brew install apple-gcc42
dhull commented 11 years ago

This does look like an error in Ruby's onig_number_of_names function. The num_entries field in the st_table of type st_index_t which is ultimately unsigned long, but onig_number_of_names returns int.

uasi commented 11 years ago

Without uninstalling Xcode or installing apple-gcc42, just turning off the -Werror will do: CFLAGS="-Wno-error=shorten-64-to-32" rvm install ...

peterpeng001 commented 11 years ago

Just do this: export CC=gcc

It solves my error.

terratakashi commented 11 years ago

export CC=gcc

It solved my problem too.

uasi commented 11 years ago

It is said that gcc shipped with Xcode 4.x (which is actually llvm-gcc) is buggy: https://github.com/sstephenson/ruby-build/issues/290#issuecomment-14013057 Maybe it's not right to do export CC=gcc.

paulwalker commented 11 years ago

export CC=gcc just sets it for that terminal session. if you want to just even use it for this use case only:

CC=gcc rvm install 1.9.3

which worked for me. no need to un-install xcode