Ruby Installation Error #436

Closed
sturma opened this Issue Feb 7, 2013 · 8 comments

Comments

Projects
None yet
7 participants
@sturma

sturma commented Feb 7, 2013

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

This comment has been minimized.

Show comment Hide comment
@sturma

sturma Feb 8, 2013

ok, solved!

  • uninstalled Xcode
  • installed macports
  • executed 'sudo port selfupdate'
  • executed 'sudo port install apple-gcc42'
  • rvm install 1.9.3: finished successfully

sturma commented Feb 8, 2013

ok, solved!

  • uninstalled Xcode
  • installed macports
  • executed 'sudo port selfupdate'
  • executed 'sudo port install apple-gcc42'
  • rvm install 1.9.3: finished successfully

@sturma sturma closed this Feb 8, 2013

@nihilismus nihilismus referenced this issue in rbenv/ruby-build Feb 11, 2013

Closed

1.9.3-p385 BUILD FAILED #281

@nesv

This comment has been minimized.

Show comment Hide comment
@nesv

nesv Feb 11, 2013

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

nesv commented Feb 11, 2013

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

This comment has been minimized.

Show comment Hide comment
@dhull

dhull Feb 11, 2013

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.

dhull commented Feb 11, 2013

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

This comment has been minimized.

Show comment Hide comment
@uasi

uasi Feb 12, 2013

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

uasi commented Feb 12, 2013

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

@PeterPeng2017

This comment has been minimized.

Show comment Hide comment
@PeterPeng2017

PeterPeng2017 Feb 13, 2013

Just do this:
export CC=gcc

It solves my error.

Just do this:
export CC=gcc

It solves my error.

@terratakashi

This comment has been minimized.

Show comment Hide comment
@terratakashi

terratakashi Feb 21, 2013

export CC=gcc

It solved my problem too.

export CC=gcc

It solved my problem too.

@uasi

This comment has been minimized.

Show comment Hide comment
@uasi

uasi Feb 25, 2013

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

uasi commented Feb 25, 2013

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

@paulwalker

This comment has been minimized.

Show comment Hide comment
@paulwalker

paulwalker Feb 28, 2013

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment