Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot compile ruby 1.9.3

Tags:

When I run

rvm install 1.9.3 --with-gcc=clang

on Mac OSX Lion, ruby does not compile, and I get the following error in (.rvm/log/ruby-1.9.3-p374/make.log)

[2013-01-29 16:31:05] 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/will/.rvm/usr/include -I. -I.ext/include/x86_64-darwin12.2.1 -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

How can I get ruby 1.9.3 to install on Lion?

like image 685
Will Avatar asked Jan 29 '13 21:01

Will


People also ask

How do I install Ruby 1.9 3 on Windows?

Install Ruby.In the Windows Explorer, double click on the rubyinstaller-1.9. 3-p194.exe file and follow the directions. By default, Ruby will be installed in the C:\Ruby193 folder. Check the boxes "Install Tcl/Tk support" and "Add Ruby executables to your PATH." Then click Install >> Finish.

What is the current Stable version of Ruby?

What is the latest Ruby version? Ruby 3.1. 0 is the Ruby latest version (3.1. 0 was released Dec 25, 2021).

How do I update Ruby on my Mac?

If you're using Ruby on a Mac, it is set up by default, but you can't modify or upgrade it. Most developers don't use the pre-installed version of Ruby on their Macs.

What is Ruby Installer?

The RubyInstaller project provides a self-contained Windows-based installer that includes a Ruby-language execution environment and a baseline set of required RubyGems and extensions, integrated with a MSYS2 installation.


1 Answers

With Xcode 4.6 I was also getting this problem. I installed the command line tools which made gcc available in /usr/bin/gcc.

I managed to get it to work using:

rvm install 1.9.3 --with-gcc=gcc

NB. I dont have homebrew installed.

like image 189
Fringley Avatar answered Sep 21 '22 18:09

Fringley