1

I am trying to install Ruby using RVM in Mountain Lion and keep on getting errors while running make, even when I do so with gcc=clang (as is the recommended solution on other posts). I have XCode updated with command line utilities installed.

The make.log reads

    [2013-02-18 17:37:00] 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/maraaverick/.rvm/usr/include -I. -I.ext/include/x86_64-darwin12.2.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  
    SOLIBS = 
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling dmyversion.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
bignum.c:2732:26: warning: while loop has empty body [-Wempty-body]
        while (--ny && !zds[ny]); ++ny;
                                ^
bignum.c:2732:26: note: put the semicolon on a separate line to silence this warning
1 warning generated.
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
gc.c:3060:1: warning: unused function 'chain_finalized_object' [-Wunused-function]
chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg)
^
1 warning generated.
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
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

The same is true when I do not specify gcc, and when I try to install with openssl and a standalone gcc package as per the recommendations here

rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr

Although when I tried to specify my local gcc I am told it's not in my path:

$ CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl
You requested building with '/opt/local/bin/gcc-apple-4.2' but it is not in your path.

Any help would be much appreciated. Thanks very much.

batpigandme
  • 147
  • 2
  • 7
  • 20
  • are you sure you have GCC installed? i think I had the same issue and reinstalling of GCC helped – Ilya Cherevkov Feb 18 '13 at 23:55
  • possible duplicate of [Cannot compile ruby 1.9.3](http://stackoverflow.com/questions/14592945/cannot-compile-ruby-1-9-3) – mpapis Feb 19 '13 at 00:43
  • @IlyaCherevkov I have GCC installed but it is not linked brew install apple-gcc42 Error: apple-gcc42-4.2.1-5666.3 already installed, it's just not linked' might this be the problem? If so- any recommendations with respect to linking it- I'm not sure how – batpigandme Feb 19 '13 at 13:08
  • @mpapis I tried the methods from that thread, but couldn't get any of them to work for me (I have run the homebrew methods, but for some reason cannot get my gcc 'linked') - I wasn't sure what forum etiquette what re. adding my own issue to the bottom of that thread - apologies if I went about it the wrong way- thanks for the link! – batpigandme Feb 19 '13 at 13:13

1 Answers1

1

you are using clang here is better explanation of the problem https://stackoverflow.com/a/14594287/497756 and here is improved process (not yet on rvm head): https://stackoverflow.com/a/14940278/497756

Community
  • 1
  • 1
mpapis
  • 52,729
  • 14
  • 121
  • 158
  • when I run it '--with-gcc=gcc-4.2' I still get the make error I then tried the new experimental method (with rvm get branch) and it resulted in (had to delete some code for length) '... Updated Homebrew from c98d5049 to e94eb707. ==> Updated Formulae bochs mapserver node stunnel texmacs toilet tuntap Installing required packages: libxml2, libxslt, libksba, curl-ca-bundle. Error running 'requirements_brew_libs_install libxml2 libxslt libksba curl-ca-bundle', please read /Users/maraaverick/.rvm/log/ruby-1.9.3-p385/package_install_libxml2_libxslt_libksba_curl-ca-bundle.log' – batpigandme Feb 19 '13 at 14:33
  • please make a [gist](https://gist.github.com) of the commands and error log and open a [ticket for RVM](https://github.com/wayneeseguin/rvm/issues) – mpapis Feb 19 '13 at 15:06