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

Closed
mrgrauel opened this Issue Oct 28, 2011 · 31 comments

Projects

None yet

9 participants

@mrgrauel

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.

@mpapis
Member
mpapis commented Oct 28, 2011

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

@mrgrauel

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

@ddd
Contributor
ddd commented Oct 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.

@ddd
Contributor
ddd commented Oct 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
"

@mpapis
Member
mpapis commented Oct 28, 2011

@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 ...

@mpapis mpapis closed this Oct 28, 2011
@mrgrauel

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?

@mpapis
Member
mpapis commented Oct 28, 2011

@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

@mrgrauel

"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 ]

@mrgrauel

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.

@mpapis
Member
mpapis commented Oct 28, 2011

@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 ?

@mrgrauel

MacBook-Air:BuyersGuide ag$ /usr/bin/gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11/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.11/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)

@mpapis
Member
mpapis commented Oct 28, 2011

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

@jrozner
jrozner commented Oct 30, 2011

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

@mpapis mpapis reopened this Oct 30, 2011
@mpapis
Member
mpapis commented Oct 30, 2011

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

@edruder
edruder commented Oct 30, 2011

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
@mpapis
Member
mpapis commented Oct 30, 2011

fixed as of 2c8d9cd

is enough to just write:

rvm install 1.9.3
@mpapis mpapis closed this Oct 30, 2011
@mpapis mpapis added a commit that referenced this issue Oct 31, 2011
@mpapis mpapis fix typo, update #534 141b2d7
@levinalex

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 .
@martinstreicher

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?

@mpapis
Member
mpapis commented Dec 1, 2011

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

@frodera
frodera commented Jan 17, 2012

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.

@mpapis
Member
mpapis commented Jan 17, 2012

@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

@frodera
frodera commented Jan 22, 2012

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.

@Jaybuz
Jaybuz commented Feb 29, 2012

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

@ddd
Contributor
ddd commented Feb 29, 2012

@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)

@Jaybuz
Jaybuz commented Feb 29, 2012

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

@ddd
Contributor
ddd commented Feb 29, 2012

@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.

@Jaybuz
Jaybuz commented Feb 29, 2012

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

@mpapis
Member
mpapis commented Feb 29, 2012

@Jaybuz have you read rvm requirements ?

@ddd
Contributor
ddd commented Feb 29, 2012

∴ rvm requirements

Notes for Mac OS X 10.7.3, Xcode 4.1.

For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'

You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer
** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.

To use an RVM installed Ruby as default, instead of the system ruby:

rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7

And reopen your terminal windows.

Xcode 4.2:

  • is only supported by ruby 1.9.3+ using command line flag: --with-gcc=clang
  • it breaks gems with native extensions, especially DB drivers.

Please read the documentation next time. Thank you!

On 2012-02-29, at 12:19 PM, Michal Papis wrote:

@Jaybuz have you read rvm requirements ?


Reply to this email directly or view it on GitHub:
#534 (comment)

@Jaybuz
Jaybuz commented Feb 29, 2012

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

@ddd
Contributor
ddd commented Feb 29, 2012

Dude, we had already done that. sheesh!

This message contains confidential information and is intended for those listed in the "To:", "CC:", and/or "BCC:" fields of the message header.If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

On 2012-02-29, at 12:26 PM, Jason Busby wrote:

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


Reply to this email directly or view it on GitHub:
#534 (comment)

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