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.
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
Related
I'm trying to install rvm and ruby. I've got rvm installed, but whenever I run rvm install x it fails. I look in make.log and I see the following:
[2020-08-07 15:49:26] __rvm_make
__rvm_make ()
{
\make "$#" || return $?
}
current path: /Users/hine/.rvm/src/ruby-2.6.5
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/hine/.cargo/bin:/Users/hine/google-cloud-sdk/bin:/usr/local/opt/ruby/bin:/Users/hine/.fastlane/bin:/Users/hine/.nvm/versions/node/v8.10.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin:/Users/hine/istio-1.0.2/bin:/Users/hine/.rvm/bin
command(2): __rvm_make -j4
++ make -j4
BASERUBY = /usr/local/opt/ruby/bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN
CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl#1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin18 -I./include -I. -I./enc/unicode/12.1.0
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl#1.1/lib -install_name /Users/hine/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib -compatibility_version 2.6 -current_version 2.6.5 -fstack-protector-strong -framework Security -framework Foundation -fstack-protector-strong -framework Security -framework Foundation
SOLIBS = -lpthread -lgmp -ldl -lobjc
LANG = en_US.UTF-8
LC_ALL =
LC_CTYPE =
Configured with: --prefix=/Users/hine/Downloads/Xcode 10.2.app/Contents/Developer/usr --with-gxx-include-dir=/Users/hine/Downloads/Xcode 10.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Users/hine/Downloads/Xcode 10.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
translating probes probes.d
compiling ast.c
compiling bignum.c
. ./vm_opts.h
compiling class.c
compiling compar.c
compiling compile.c
compiling complex.c
compiling cont.c
compiling debug.c
compiling debug_counter.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling file.c
compiling gc.c
compiling hash.c
compiling inits.c
compiling io.c
compiling iseq.c
compiling load.c
compiling marshal.c
compiling math.c
making mjit_config.h
compiling mjit_compile.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling proc.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
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling symbol.c
compiling thread.c
compiling time.c
compiling transcode.c
compiling transient_heap.c
compiling util.c
compiling variable.c
./revision.h unchanged
compiling vm.c
compiling vm_backtrace.c
compiling vm_dump.c
compiling vm_trace.c
compiling ./missing/explicit_bzero.c
compiling ./missing/setproctitle.c
compiling addr2line.c
compiling dmyenc.c
config.status: creating ruby-runner.h
compiling dln.c
compiling localeinit.c
compiling prelude.c
compiling array.c
compiling mjit.c
assembling coroutine/amd64/Context.S
compiling enc/ascii.c
compiling enc/us_ascii.c
compiling enc/unicode.c
compiling enc/utf_8.c
compiling enc/trans/newline.c
compiling version.c
building rb_mjit_header.h
linking miniruby
rb_mjit_header.h updated
generating encdb.h
building .ext/include/x86_64-darwin18/rb_mjit_min_header-2.6.5.h
./miniruby -I./lib -I. -I.ext/common ./tool/transform_mjit_header.rb "gcc " rb_mjit_header.h .ext/include/x86_64-darwin18/rb_mjit_min_header-2.6.5.h
encdb.h updated
./tool/ifchange "--timestamp=.rbconfig.time" rbconfig.rb rbconfig.tmp
rbconfig.rb updated
generating enc.mk
creating verconf.h
verconf.h updated
compiling loadpath.c
making srcs under enc
/bin/sh: /Users/hine/Downloads/Xcode: No such file or directory
make: *** [srcs-enc] Error 127
make: *** Waiting for unfinished jobs....
Transforming external functions to static:
transform_mjit_header: making external definition of 'Init_vm_stack_canary' static inline
transform_mjit_header: making external definition of 'rb_vm_opt_struct_aset' static inline
transform_mjit_header: making external definition of 'rb_vm_opt_struct_aref' static inline
transform_mjit_header: making external definition of 'rb_eql_opt' static inline
transform_mjit_header: changing definition of 'rb_equal_opt' to declaration
transform_mjit_header: changing definition of 'rb_vm_search_method_slowpath' to declaration
transform_mjit_header: making external definition of 'rb_vm_rewrite_cref' static inline
transform_mjit_header: making external definition of 'rb_vm_push_frame' static inline
transform_mjit_header: making external definition of 'rb_vm_block_ep_update' static inline
transform_mjit_header: making external definition of 'rb_vm_cref_new_toplevel' static inline
transform_mjit_header: making external definition of 'rb_vm_frame_block_handler' static inline
transform_mjit_header: making external definition of 'rb_vm_ep_local_ep' static inline
transform_mjit_header: making declaration of 'rb_vm_rewrite_cref' static inline
transform_mjit_header: making declaration of 'rb_vm_frame_block_handler' static inline
transform_mjit_header: making declaration of 'rb_vm_block_ep_update' static inline
transform_mjit_header: making declaration of 'rb_vm_ep_local_ep' static inline
transform_mjit_header: SKIPPED to transform __sigbits
transform_mjit_header: making declaration of 'Init_vm_stack_canary' static inline
transform_mjit_header: making declaration of 'rb_eql_opt' static inline
transform_mjit_header: SKIPPED to transform __sincospi
transform_mjit_header: SKIPPED to transform __sincospif
transform_mjit_header: SKIPPED to transform __sincos
transform_mjit_header: SKIPPED to transform __sincosf
transform_mjit_header: SKIPPED to transform __inline_isnormall
transform_mjit_header: SKIPPED to transform __inline_isnormald
transform_mjit_header: SKIPPED to transform __inline_isnormalf
transform_mjit_header: SKIPPED to transform __inline_signbitl
transform_mjit_header: SKIPPED to transform __inline_signbitd
transform_mjit_header: SKIPPED to transform __inline_signbitf
transform_mjit_header: SKIPPED to transform __inline_isnanl
transform_mjit_header: SKIPPED to transform __inline_isnand
transform_mjit_header: SKIPPED to transform __inline_isnanf
transform_mjit_header: SKIPPED to transform __inline_isinfl
transform_mjit_header: SKIPPED to transform __inline_isinfd
transform_mjit_header: SKIPPED to transform __inline_isinff
transform_mjit_header: SKIPPED to transform __inline_isfinitel
transform_mjit_header: SKIPPED to transform __inline_isfinited
transform_mjit_header: SKIPPED to transform __inline_isfinitef
transform_mjit_header: SKIPPED to transform __sputc
ln -sf ../../../.ext/include/x86_64-darwin18/rb_mjit_min_header-2.6.5.h include/ruby-2.6.0/x86_64-darwin18/rb_mjit_min_header-2.6.5.h
++ return 2
tl;dir:
/bin/sh: /Users/hine/Downloads/Xcode: No such file or directory
make: *** [srcs-enc] Error 127
So this is correct that Xcode is not at Downloads/Xcode. It's actually at Downloads/Xcode 10.2.
How do I make rvm know that?
I am trying to compile some software that contains a compile.sh shell script. When I run the script, the software fails to compile due to what it reports as a broken C compiler.
I have tried reinstalling C compilers, both within and outside of conda, to no avail.
Below, please find the output of running the compile shell script
(base) userA#server:~/SPAdes-3.13.0-dev$ ./spades_compile.sh
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc
-- Check for working C compiler: /home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -- broken
CMake Error at /home/userA/anaconda3/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_708f4/fast
/usr/bin/make -f CMakeFiles/cmTC_708f4.dir/build.make CMakeFiles/cmTC_708f4.dir/build
make[1]: Entering directory '/home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -o CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o -c /home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_708f4
/home/userA/anaconda3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_708f4.dir/link.txt --verbose=1
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -rdynamic CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o -o cmTC_708f4
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find crtbeginS.o: No such file or directory
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lgcc
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_708f4.dir/build.make:86: recipe for target 'cmTC_708f4' failed
make[1]: *** [cmTC_708f4] Error 1
make[1]: Leaving directory '/home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_708f4/fast' failed
make: *** [cmTC_708f4/fast] Error 2
CMake will not be able to correctly generate this project.
Expected result: properly compiled software
Actual result: report of a broken C compiler
I am trying to use RVM to install Ruby. I have been following the Installfest guide over at RailsBridge.
So far, I have installed RVM (curl -L get.rvm.io | bash -s stable) and configured RVM to use Homebrew (rvm autolibs homebrew). When I enter rvm install ruby into Terminal, I get the following output:
ruby-2.5.1 - #removing src/ruby-2.5.1..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.13/x86_64/ruby-2.5.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Certificates bundle '/usr/local/etc/openssl#1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/jules/.rvm/rubies/ruby-2.5.1, this may take a while depending on your cpu(s)...
ruby-2.5.1 - #downloading ruby-2.5.1, this may take a while depending on your connection...
ruby-2.5.1 - #extracting ruby-2.5.1 to /Users/jules/.rvm/src/ruby-2.5.1.....
ruby-2.5.1 - #configuring......................................................|
ruby-2.5.1 - #post-configuration.
ruby-2.5.1 - #compiling....
Error running '__rvm_make -j8',
please read /Users/jules/.rvm/log/1530823409_ruby-2.5.1/make.log
There has been an error while running make. Halting the installation.
I opened /Users/jules/.rvm/log/1530823409_ruby-2.5.1/make.log in an attempt to make progress, but I wasn't able to glean any meaning from the file. I have pasted the contents below:
[2018-07-05 16:44:45] __rvm_make
__rvm_make ()
{
\make "$#" || return $?
}
current path: /Users/jules/.rvm/src/ruby-2.5.1
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/jules/anaconda2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/jules/.rvm/bin
command(2): __rvm_make -j8
++ make -j8
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl#1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin17 -I./include -I. -I./enc/unicode/10.0.0
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl#1.1/lib -install_name /Users/jules/.rvm/rubies/ruby-2.5.1/lib/libruby.2.5.dylib -compatibility_version 2.5 -current_version 2.5.1 -fstack-protector -framework Foundation -fstack-protector -framework Foundation
SOLIBS = -lpthread -lgmp -ldl -lobjc
LANG = en_US.UTF-8
LC_ALL =
LC_CTYPE =
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
compiling compar.c
compiling compile.c
error: error reading '/dev/fd/7'
1 error generated.
clang: error: unable to remove file: Operation not permitted
dtrace: failed to compile script probes.d: Preprocessor failed to process input program
make: *** [probes.h] Error 1
make: *** Waiting for unfinished jobs....
++ return 2
Where should I go from here? Cheers!
Update: I Googled error: error reading '/dev/fd/7' from make.log and solved the problem by uninstalling Avira: https://github.com/rvm/rvm/issues/4313.
This worked for me:
rvm install ruby-2.5.1 --with-openssl-dir=/usr/local/opt/openssl
The openssl flag fixed my error! In case it's helpful, the last line of mymake.log was:
openssl_missing.c:39:18: error: expected ';' after top level declarator
EVP_MD_CTX_create(void)
This worked for me:
renaming /usr/local/include to /usr/local/include_old
Ref: Broken c++ std libraries on macOS High Sierra 10.13
This is my first time using Ruby. I became aware not to use sudo to install Gems so I followed this tutotrial (http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac) to install RVM so that I could update my version of Ruby and then install Middleman (http://middlemanapp.com/).
RVM installation worked, but when installing Ruby 1.9.3 at the '#compiling' stage I get the following error:
Error running 'make', please read
/Users/Mark/.rvm/log/ruby-1.9.3-p385/make.log There has been an error
while running make. Halting the installation.
I opened the log file and unlike a lot of other issues I've seen, the file doesn't contain references to 'readline' but to 'compiling' which I assume relates to the '#compiling' stage of the Ruby install. Below is the output to make.log:
[2013-02-12 09:04:26] 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/Mark/.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
If I run 'make --version' I get the following output:
GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This
is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
This program built for i386-apple-darwin11.3.0
I'm struggling to find an exact matching issue, so if anyone could help that would be great.
Cheers,
Mark.
I followed some of the advice here and in other posts linked and Googled, but in the end, updating GCC via Homebrew is what finally got the Ruby installation to complile and complete.
Specific link I used for updating GCC: Installing Ruby on Mac OS X 10.8.2
So thanks for all the help, I can't be sure if it was a combination of all the updates and cleanup as well as GCC or just GCC, but I'm up and running.
Although you don't see the error it is in fact caused by readline. As mentioned by atmosx I'd remove the default MAC OS X install of ruby and follow the process from the beginning.
Or following this https://rvm.io/packages/readline/ to help resolve readline. Also for reference look at this previous question: Error running make when installing Ruby 1.8.7-p302 via RVM on Mac OS 10.5.8
So complete steps are:
rvm pkg install readline
rvm remove 1.8.7
rvm cleanup all
rvm install 1.8.7 -C –with-readline-dir=$rvm_path/usr
Thanks to Andrew at http://anlek.com/2011/01/rvm-install-1-8-7-p330-fails/ for the pointer.
I've been having some problems installing Ruby 1.9.3 (or any version after 1.8.7 for that matter).
See below for error log:
[2012-10-26 19:26:24] make
CC = clang
LD = ld
LDSHARED = clang -dynamiclib
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 -I/Users/username/.rvm/usr/include -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I. -I.ext/include/x86_64-darwin10.8.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/username/.rvm/rubies/ruby-1.9.3-p286/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,_Init_* -Wl,-unexported_symbol,*_threadptr_* -Wl,-u,_objc_msgSend
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
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
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
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling time.c
compiling transcode.c
compiling util.c
compiling variable.c
compiling compile.c
compiling debug.c
compiling iseq.c
compiling vm.c
In file included from vm.c:25:
In file included from ./vm_exec.c:106:
insns.def:634:9: warning: explicitly assigning a variable of type 'VALUE' (aka 'unsigned long') to itself [-Wself-assign]
val = val;
~~~ ^ ~~~
In file included from vm.c:27:
./vm_method.c:102:85: warning: unused variable 'prev_ume' [-Wunused-variable]
struct unlinked_method_entry_list_entry *ume = vm->unlinked_method_entry_list, *prev_ume = 0, *curr_ume;
^
./vm_method.c:102:100: warning: unused variable 'curr_ume' [-Wunused-variable]
struct unlinked_method_entry_list_entry *ume = vm->unlinked_method_entry_list, *prev_ume = 0, *curr_ume;
^
3 warnings generated.
compiling vm_dump.c
compiling thread.c
compiling cont.c
compiling ./enc/ascii.c
compiling ./enc/us_ascii.c
compiling ./enc/unicode.c
compiling ./enc/utf_8.c
compiling newline.c
compiling ./missing/setproctitle.c
linking miniruby
rbconfig.rb updated
generating enc.mk
compiling dln.c
compiling encoding.c
generating prelude.c
compiling prelude.c
linking static-library libruby.1.9.1-static.a
linking shared-library libruby.1.9.1.dylib
generating encdb.h
encdb.h unchanged
making enc
compiling ./enc/encdb.c
linking encoding encdb.bundle
compiling ./enc/big5.c
linking encoding big5.bundle
compiling ./enc/cp949.c
linking encoding cp949.bundle
compiling ./enc/emacs_mule.c
linking encoding emacs_mule.bundle
compiling ./enc/euc_jp.c
linking encoding euc_jp.bundle
compiling ./enc/euc_kr.c
linking encoding euc_kr.bundle
compiling ./enc/euc_tw.c
linking encoding euc_tw.bundle
compiling ./enc/gb2312.c
linking encoding gb2312.bundle
compiling ./enc/gb18030.c
linking encoding gb18030.bundle
compiling ./enc/gbk.c
linking encoding gbk.bundle
compiling ./enc/iso_8859_1.c
linking encoding iso_8859_1.bundle
compiling ./enc/iso_8859_2.c
linking encoding iso_8859_2.bundle
compiling ./enc/iso_8859_3.c
linking encoding iso_8859_3.bundle
compiling ./enc/iso_8859_4.c
linking encoding iso_8859_4.bundle
compiling ./enc/iso_8859_5.c
linking encoding iso_8859_5.bundle
compiling ./enc/iso_8859_6.c
linking encoding iso_8859_6.bundle
compiling ./enc/iso_8859_7.c
linking encoding iso_8859_7.bundle
compiling ./enc/iso_8859_8.c
linking encoding iso_8859_8.bundle
compiling ./enc/iso_8859_9.c
linking encoding iso_8859_9.bundle
compiling ./enc/iso_8859_10.c
linking encoding iso_8859_10.bundle
compiling ./enc/iso_8859_11.c
linking encoding iso_8859_11.bundle
compiling ./enc/iso_8859_13.c
linking encoding iso_8859_13.bundle
compiling ./enc/iso_8859_14.c
linking encoding iso_8859_14.bundle
compiling ./enc/iso_8859_15.c
linking encoding iso_8859_15.bundle
compiling ./enc/iso_8859_16.c
linking encoding iso_8859_16.bundle
compiling ./enc/koi8_r.c
linking encoding koi8_r.bundle
compiling ./enc/koi8_u.c
linking encoding koi8_u.bundle
compiling ./enc/shift_jis.c
linking encoding shift_jis.bundle
compiling ./enc/utf_16be.c
linking encoding utf_16be.bundle
compiling ./enc/utf_16le.c
linking encoding utf_16le.bundle
compiling ./enc/utf_32be.c
linking encoding utf_32be.bundle
compiling ./enc/utf_32le.c
linking encoding utf_32le.bundle
compiling ./enc/windows_1251.c
linking encoding windows_1251.bundle
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
transdb.h unchanged
making trans
compiling ./enc/trans/transdb.c
linking transcoder transdb.bundle
compiling ./enc/trans/big5.c
linking transcoder big5.bundle
compiling ./enc/trans/chinese.c
linking transcoder chinese.bundle
compiling ./enc/trans/emoji.c
linking transcoder emoji.bundle
compiling ./enc/trans/emoji_iso2022_kddi.c
linking transcoder emoji_iso2022_kddi.bundle
compiling ./enc/trans/emoji_sjis_docomo.c
linking transcoder emoji_sjis_docomo.bundle
compiling ./enc/trans/emoji_sjis_kddi.c
linking transcoder emoji_sjis_kddi.bundle
compiling ./enc/trans/emoji_sjis_softbank.c
linking transcoder emoji_sjis_softbank.bundle
compiling ./enc/trans/escape.c
linking transcoder escape.bundle
compiling ./enc/trans/gb18030.c
linking transcoder gb18030.bundle
compiling ./enc/trans/gbk.c
linking transcoder gbk.bundle
compiling ./enc/trans/iso2022.c
linking transcoder iso2022.bundle
compiling ./enc/trans/japanese.c
linking transcoder japanese.bundle
compiling ./enc/trans/japanese_euc.c
linking transcoder japanese_euc.bundle
compiling ./enc/trans/japanese_sjis.c
linking transcoder japanese_sjis.bundle
compiling ./enc/trans/korean.c
linking transcoder korean.bundle
compiling ./enc/trans/single_byte.c
linking transcoder single_byte.bundle
compiling ./enc/trans/utf8_mac.c
linking transcoder utf8_mac.bundle
compiling ./enc/trans/utf_16_32.c
linking transcoder utf_16_32.bundle
making encs
configuring -test-/add_suffix
configuring -test-/array/resize
configuring -test-/bug-3571
configuring -test-/bug-3662
configuring -test-/funcall
configuring -test-/load/dot.dot
configuring -test-/old_thread_select
configuring -test-/st/numhash
configuring -test-/string
configuring -test-/wait_for_single_fd
configuring -test-/win32/dln
Failed to configure -test-/win32/dln. It will not be installed.
configuring -test-/win32/fd_setsize
Failed to configure -test-/win32/fd_setsize. It will not be installed.
configuring bigdecimal
configuring continuation
configuring coverage
configuring curses
configuring date
configuring dbm
configuring digest
configuring digest/bubblebabble
configuring digest/md5
configuring digest/rmd160
configuring digest/sha1
configuring digest/sha2
configuring dl
configuring dl/callback
configuring dl/win32
Failed to configure dl/win32. It will not be installed.
configuring etc
configuring fcntl
configuring fiber
configuring fiddle
configuring gdbm
Failed to configure gdbm. It will not be installed.
configuring iconv
configuring io/console
configuring io/nonblock
configuring io/wait
configuring json
configuring json/generator
configuring json/parser
configuring mathn/complex
configuring mathn/rational
configuring nkf
configuring objspace
configuring openssl
configuring pathname
configuring psych
configuring pty
configuring racc/cparse
configuring readline
configuring ripper
configuring sdbm
configuring socket
configuring stringio
configuring strscan
configuring syck
configuring syslog
configuring tk
check functions.........
check struct members..
check libraries....
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh....................................
Valid [tclConfig.sh, tkConfig.sh] are found in [["/System/Library/Frameworks/Tcl.framework", "/System/Library/Frameworks/Tk.framework"], ["/usr/lib", "/usr/lib"], ["/System/Library/Frameworks/Tcl.framework/Versions/Current", "/System/Library/Frameworks/Tk.framework/Versions/Current"], ["/System/Library/Frameworks/Tcl.framework/Versions/8.5", "/System/Library/Frameworks/Tk.framework/Versions/8.5"], ["/System/Library/Frameworks/Tcl.framework/Versions/8.4", "/System/Library/Frameworks/Tk.framework/Versions/8.4"]]
Use [tclConfig.sh, tkConfig.sh] == ["/System/Library/Frameworks/Tcl.framework/tclConfig.sh", "/System/Library/Frameworks/Tk.framework/tkConfig.sh"]
Use MacOS X Frameworks.
Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk.
configuring tk/tkutil
configuring win32ole
Failed to configure win32ole. It will not be installed.
configuring zlib
Failed to configure zlib. It will not be installed.
linking shared-object -test-/add_suffix/bug.bundle
installing default bug libraries
compiling resize.c
linking shared-object -test-/array/resize.bundle
installing default resize libraries
compiling bug.c
linking shared-object -test-/bug-3571/bug.bundle
installing default bug libraries
compiling bug.c
linking shared-object -test-/bug-3662/bug.bundle
installing default bug libraries
compiling passing_block.c
linking shared-object -test-/funcall/funcall.bundle
installing default funcall libraries
compiling dot.dot.c
linking shared-object -test-/load/dot.dot/dot.dot.bundle
installing default dot.dot libraries
linking shared-object -test-/old_thread_select/old_thread_select.bundle
installing default old_thread_select libraries
compiling numhash.c
linking shared-object -test-/st/numhash.bundle
installing default numhash libraries
compiling cstr.c
compiling ellipsize.c
compiling enc_associate.c
compiling init.c
compiling modify.c
compiling set_len.c
linking shared-object -test-/string/string.bundle
installing default string libraries
linking shared-object -test-/wait_for_single_fd/wait_for_single_fd.bundle
installing default wait_for_single_fd libraries
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all'.
linking shared-object bigdecimal.bundle
installing default bigdecimal libraries
compiling continuation.c
linking shared-object continuation.bundle
installing default continuation libraries
compiling coverage.c
linking shared-object coverage.bundle
installing default coverage libraries
compiling curses.c
linking shared-object curses.bundle
installing default curses libraries
linking shared-object date_core.bundle
installing default date_core libraries
compiling dbm.c
dbm.c:818:16: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
if (val.dsize == (int)RSTRING_LEN(valstr) &&
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
1 warning generated.
linking shared-object dbm.bundle
installing default dbm libraries
compiling digest.c
linking shared-object digest.bundle
installing digest libraries
installing default digest libraries
compiling bubblebabble.c
linking shared-object digest/bubblebabble.bundle
installing default bubblebabble libraries
compiling md5init.c
linking shared-object digest/md5.bundle
ld: warning: ignoring file /usr/local/lib/libz.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: in /usr/local/lib/libz.1.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture
x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../../.ext/x86_64-darwin10.8.0/digest/md5.bundle] Error 1
make[1]: *** [ext/digest/md5/all] Error 2
make: *** [build-ext] Error 2
I'm trying to install through RVM but just installing Ruby from source isn't helping. I can't seem to figure out what's going on. I tried appending --with-gcc=clang and env ARCHFLAGS="-arch x86_64"
Any advice is much appreciated! Thanks.
You have an incompatibly-built version of libz installed in /usr/local/lib, perhaps from Homebrew, probably a 32-bit only version where now you need a 64-bit or universal version. You could just delete it at the risk of breaking something else you have installed or you could update it. A safer option: temporarily mv it to another location before you install ruby and then mv it back. You shouldn't need it as OS X supplies a version of libz.