Skip to content
This repository

Unable to install 1.9.3-head on OS X Lion 10.7.2 #534

Closed
angrauel opened this Issue October 28, 2011 · 31 comments

9 participants

Andreas Grauel Michal Papis D. Deryl Downey Joe Rozner Ed Ruder Levin Alexander Martin Streicher Francisco Jason Busby
Andreas Grauel

I have OS X Lion 10.7.2 and RVM 1.9.0 installed. I currently have 1.9.2-head installed and wanted to update to 1.9.3-head, but I get an Error.

rvm install 1.9.3-head
Installing Ruby from source to: /Users/ag/.rvm/rubies/ruby-1.9.3-head, this may take a while depending on your cpu(s)...

ruby-1.9.3-head - #fetching
HEAD is now at 4197f33 merges r32345 from trunk into ruby_1_9_2.
Checking out files: 100% (1694/1694), done.
Switched to branch 'ruby_1_9_3'
From git://github.com/ruby/ruby

  • branch ruby_1_9_3 -> FETCH_HEAD Already up-to-date. Copying from repo to src path... Running autoreconf Fetching yaml-0.1.4.tar.gz to /Users/ag/.rvm/archives Extracting yaml-0.1.4.tar.gz to /Users/ag/.rvm/src Configuring yaml in /Users/ag/.rvm/src/yaml-0.1.4. Compiling yaml in /Users/ag/.rvm/src/yaml-0.1.4. Installing yaml to /Users/ag/.rvm/usr ruby-1.9.3-head - #configuring ERROR: Error running ' ./configure --prefix=/Users/ag/.rvm/rubies/ruby-1.9.3-head --enable-shared --disable-install-doc --with-libyaml-dir=/Users/ag/.rvm/usr ', please read /Users/ag/.rvm/log/ruby-1.9.3-head/configure.log ERROR: There has been an error while running configure. Halting the installation.

cat /Users/ag/.rvm/log/ruby-1.9.3-head/configure.log
[2011-10-28 14:08:47] ./configure --prefix=/Users/ag/.rvm/rubies/ruby-1.9.3-head --enable-shared --disable-install-doc --with-libyaml-dir=/Users/ag/.rvm/usr
checking build system type... x86_64-apple-darwin11.2.0
checking host system type... x86_64-apple-darwin11.2.0
checking target system type... x86_64-apple-darwin11.2.0
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

I can install any other kind of ruby version but not any 1.9.3 version.

Michal Papis
Collaborator

what is your Xcode version, do you have llvm and gcc installed , is $GCC variable set to something ?

Andreas Grauel

Xcode 4.2 AppStore Version so llvm and gcc is installed. The variable I'll check as soon as I am at home

D. Deryl Downey
ddd commented October 28, 2011

@mpapis @angrauel

Its because 4.2 does not have the gcc-4.2 binary. We set CC to that. When no binary is found, it reports that it can not make executables. (That and when the bin is set to wrong permissions such as readonly). With 4.2 its all llvm-gcc. They removed the normal gcc entirely. Thats the problem. the llvm-gcc doesn't build items correctly and some of the rubies have issues. thats all I can say. I can't track it down to THIS EXACT ITEM level. We need the configure.log and make log at the least to be able to determine anything at all. This is not an overnight "we got the solution" issue. This is going to take some time to suss out.

Back out Xcode 4.2 completely and install Xcode 4.1. The link is in rvm requirements output.

D. Deryl Downey
ddd commented October 28, 2011

Also, no offense but users need to start reading the docs locally, and on the site. The installation and rvm requirements both specifically state:

"** Lion Users: DO NOT use Xcode Version 4.2.x for OS X Lion. It currently fails to build several rubies and gems,
as well as several Homebrew and Macports packages as well. Xcode Version 4.1 (4B110) works.
You can find Xcode 4.1 for OS X Lion at:
https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.1_for_lion/xcode_4.1_for_lion.dmg
"

Michal Papis
Collaborator

@angrauel you can try to experiment with Xcode 4.2 - but we can not guaranty any results, easiest way most likely will be to link llvm compile binary to /usr/bin/gcc-4.2 ...

Michal Papis mpapis closed this October 28, 2011
Andreas Grauel

Thank for your help, but as an iOS Developer I do need Xcode 4.2 and cannot go back to 4.1. Are you gonna fix it in an upcoming release?

Michal Papis
Collaborator

@angrauel as i wrote already you need to try by yourself to link one of C++ compilers available in Xcode 4.2 to /usr/bin/gcc-4.2 - if you have any success compiling it this way please let us know and we will try to include your solution in RVM

Andreas Grauel

"CC=/usr/bin/gcc rvm install 1.9.3-head" this one is working

rvm list

rvm rubies

=> ruby-1.9.2-head [ i386 ]
ruby-1.9.3-head [ x86_64 ]

Andreas Grauel

ok there seems to be a problem with gem now....
rvm gem upgrade --system
WARN: Please note that rvm gem ... is only an alias to rvm do gem ...,
it might work different as in earlier versions of RVM and will be shortly removed!
WARN: rvm do gem upgrade '--system' is depracated, use rvm all do gem upgrade '--system' or rvm 1.9.2 do gem upgrade '--system' instead.
ERROR: While executing gem ... (RuntimeError)
Unknown command upgrade
ERROR: While executing gem ... (RuntimeError)
Unknown command upgrade

when i change to ruby 1.9.2 everything is working.

Michal Papis
Collaborator

@angrauel could I also ask for gcc -v - does it also allow to compile other rubies like 1.9.2 or 1.8.7, rbx, jruby ?

Andreas Grauel

MacBook-Air:BuyersGuide ag$ /usr/bin/gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

Michal Papis
Collaborator

@angrauel maybe this is the issue which made requirement for older Xcode ?

Joe Rozner

rvm install 1.9.3-p0 --with-gcc=clang works as of rvm 1.9.1 with XCode 4.2

Michal Papis mpapis reopened this October 30, 2011
Michal Papis
Collaborator

as instructed here: http://svn.ruby-lang.org/repos/ruby/tags/v1_9_3_0/NEWS we should be able to use Xcode 4.2 using --with-gcc=clang

Ed Ruder

rvm install 1.9.3-p0 --with-gcc=clang successfully built 1.9.3-p0 with Xcode 4.2 on Lion 10.7.2.

More info:

$ which clang; clang -v
/usr/bin/clang
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.2.0
Thread model: posix
Michal Papis
Collaborator

fixed as of 2c8d9cd

is enough to just write:

rvm install 1.9.3
Michal Papis mpapis closed this October 30, 2011
Michal Papis mpapis referenced this issue from a commit October 31, 2011
Michal Papis fix typo, update #534 141b2d7
Levin Alexander

as of 8adc780

rvm install 1.9.3

no longer works with XCode 4.2 when gcc is not installed:

$ rvm install 1.9.3-p0 --with-gcc=clang
ERROR: The autodetected CC(clang) is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`, and set CC=/path/to/gcc .
Martin Streicher

Running Lion 10.7.2, Xcode 4.2.1, building with command rvm install 1.9.3-head --with-gcc=clang yields my old favorite...

configuring zlib
/bin/sh: line 0: cd: ext/-test-/add_suffix: No such file or directory
make[1]: *** [ext/-test-/add_suffix/all] Error 1
make: *** [build-ext] Error 2

Any suggestions?

Michal Papis
Collaborator

as discussed yesterday on #RVM it looks like ruby-head/compilation stack issue, please discuss with ruby(mri) team

Francisco

Running Lion 10.7.2, Xcode 4.2.1. and GCC installed from https://github.com/kennethreitz/osx-gcc-installer

rvm install 1.9.3 --with-gcc=gcc-4.2

Worked for me.
Just my 2 cents.

Michal Papis
Collaborator

@frodera i need to warn you that Xcode 4.2.1 and osx-gcc-installer not always play nice together - especially for native extension gems

Francisco

Thanks @mpapis for the warning. I do not really need Xcode, so I have uninstalled it and left osx-gcc-installer. Hombrew seems happy with that and gems are getting installed properly on rvm.

Jason Busby

@frodera Thank you so much for sharing this! They should probably update RVM with that.

D. Deryl Downey

@jaybuz nothing to update in rvm. We don't install, manage, control, or otherwise dictate the compiler. Thats all you, as the user. We have gone way out on limbs trying to find the correct combination of settings for RVM to help you get compilations right once you do have a compiler installed that is usable.

The problem stems from Apple's changes to their Xcode package and their compiler. Has nothing to do with RVM. We just get to clean up the mess because the users don't understand that.

And btw, we all do advocate the ox-gcc-installer. Its just that a lot of the users need the headers that are stripped out to make it smaller for such things as Node.js (Carbon headers) ect. And we can not stop supporting Xcode as thats the defacto compiler suite on OS X. (Which I run myself)

Jason Busby

@deryldoucette I'm using the ox-gcc-installer. No xcode here.

D. Deryl Downey

@Jaybuz OK, but thats individualistic. We have to support Xcode and the osx-gcc-installer. The great majority of the OSX user base uses Xcode not osx-gcc-installer. More are moving over, but we have to support Xcode, itself, directly. RVM can not just support the stripped down and repackaged Xcode (which is what osx-gcc-installer actually is). Its a "the majority rules" thing.

Jason Busby

Well can't you just add a little comment about it? I spent hours looking for a fix.

Michal Papis
Collaborator

@Jaybuz have you read rvm requirements ?

D. Deryl Downey
Jason Busby

I'm on about setting the gcc version: --with-gcc=gcc-4.2

D. Deryl Downey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.