Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.1.1 build failed on Mavericks #579

Closed
vincenzomerolla opened this issue Apr 15, 2014 · 40 comments
Closed

Ruby 2.1.1 build failed on Mavericks #579

vincenzomerolla opened this issue Apr 15, 2014 · 40 comments

Comments

@vincenzomerolla
Copy link

Hey,

I'm having trouble installing Ruby 2.1.1 on my iMac running OSX 10.9.2 (Mavericks). Can someone identify the issue from my log?

$ rbenv install 2.1.1
Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
Installing ruby-2.1.1...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/ft/wdkgq_yx5r91dwfm9mbcyyxw0000gn/T/ruby-build.20140415004206.96361
Results logged to /var/folders/ft/wdkgq_yx5r91dwfm9mbcyyxw0000gn/T/ruby-build.20140415004206.96361.log
compiling ossl_x509store.c
installing default openssl libraries
linking shared-object openssl.bundle
linking shared-object ripper.bundle
make: *** [build-ext] Error 2
@woeldiche
Copy link

I get the same error trying to install 2.1.1 or 2.1.0 with rbenv. First it failed trying to link openssl, then I installed it manually with homebrew and now it fails on linking ripper instead.

@mislav mislav changed the title Ruby 2.1.1 Build Failed Ruby 2.1.1 build failed on Mavericks Apr 15, 2014
@mislav
Copy link
Member

mislav commented Apr 15, 2014

See rbenv/ruby-build#550

I don't know the cause yet 😿

@alwillis
Copy link

Ditto on the error; even on a freshly installed Mavericks install no less.

@orospakr
Copy link

I worked around this by uninstalling my homebrew readline package. Apparently GNU Readline 6.3 is ABI incompatible with what Ruby currently expects. Same results with either 2.1.0 or 2.1.1. Upstream apparently has a fix: https://bugs.ruby-lang.org/issues/9578. However, I did not have success trying to massage their patches into working with --patch, so I went with the route of uninstalling GNU readline and leaving only OSX's built-in editline wrapper in place.

However, I got over that hurdle only to stumble into an apparent resurgence of rbenv/ruby-build#377: ruby-build isn't noticing my brew-installed copy of OpenSSL 1.0.1g. Not been a good week to install Ruby on a Mac, apparently. Anyone else run into this after working around the readline error?

@arvsr1988
Copy link

what @orospakr suggested fixed the problem.

@andersennl
Copy link

I've got the same error, tried to install ruby 2.1.0 via rbenv today.

@aaronadamsCA
Copy link

I had too many dependencies to completely uninstall the Homebrew readline package, but here's a quick and easy workaround that worked for me (from rbenv/ruby-build#550 (comment)):

brew uninstall readline
brew install https://raw.githubusercontent.com/Homebrew/homebrew/0181c8a1633353affefabe257c170edbd6d7c008/Library/Formula/readline.rb
brew pin readline

Edit: This is fixed in Ruby 2.1.2, use it instead!

@chrsvl
Copy link

chrsvl commented Apr 23, 2014

@aaronadamsTO thanks, it worked!

@juanazam
Copy link

Applying this patch its another possible workaround.

@thommahoney
Copy link

@juanazam thank you. The patch is the best solution at this time.

@andyleejordan
Copy link

@juanazam 👍 Thanks man!

@andyleejordan
Copy link

If anyone else is using rbenv and wants a patched install of either 2.1.1 or 2.0.0-p451 (which is having the same issue), here's a post on it.

@alwillis
Copy link

@andschwa Thanks for posting this; works great.

@mattbrewer
Copy link

@andschwa Thanks for the post, worked great!

@andyleejordan
Copy link

No problem!

@nikhilbhardwaj
Copy link

@aaronadamsTO Thanks it worked for me.

@negibouze
Copy link

@andschwa Thanks for posting this; works great!

@gregclar
Copy link

gregclar commented May 2, 2014

@andschwa. Thanks for the post - worked great.

@jclark42796
Copy link

@aaronadamsTO worked for me, thanks!

@brobertsaz
Copy link

@aaronadamsTO Thanks it worked for me as well!!

@aaronadamsCA
Copy link

Note that this issue was fixed in Ruby 2.1.2.

@andyleejordan
Copy link

Can concur with @aaronadamsTO. The issue is fixed.

@sc0ttman
Copy link

sc0ttman commented Jul 1, 2014

+1 for readline fix

@Remzi1993
Copy link

I also try the readline fix, but for me it doesn't work :(

brew uninstall readline
brew install https://raw.githubusercontent.com/Homebrew/homebrew/0181c8a1633353affefabe257c170edbd6d7c008/Library/Formula/readline.rb
brew pin readline

@aaronadamsCA
Copy link

Again, please note that this issue was fixed in Ruby 2.1.2 and up. The patch above is no longer necessary.

@Remzi1993
Copy link

So, it works when I install the latest version of Ruby?
I also need to install with rbenv ruby version 1.9.3-p194
So I do rbenv install 1.9.3-p194
Than I also get an Build Failed error message :(

@aaronadamsCA
Copy link

It's possible you've got multiple versions of readline installed, and that rbenv is still looking at a newer one. Try this:

brew uninstall --force readline
brew install https://raw.githubusercontent.com/Homebrew/homebrew/0181c8a1633353affefabe257c170edbd6d7c008/Library/Formula/readline.rb
brew pin readline

@Remzi1993
Copy link

Yes, I have execute your terminal commands, but nothing works :(

| => rbenv install 1.9.3-p194
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /Users/Remzi/.rbenv/versions/1.9.3-p194

Downloading ruby-1.9.3-p194.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/46e2fa80be7efed51bd9cdc529d1fe22ebc7567ee0f91db4ab855438cf4bd8bb
Installing ruby-1.9.3-p194...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/zw/064_dxn92d5czpzx1ckslvzc0000gn/T/ruby-build.20140729171306.65724
Results logged to /var/folders/zw/064_dxn92d5czpzx1ckslvzc0000gn/T/ruby-build.20140729171306.65724.log

Last 10 log lines:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/openssl/x509_vfy.h:465:6: note: 'X509_STORE_CTX_set_time' declared here
void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
     ^
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
installing default openssl libraries
installing default ripper libraries
39 warnings generated.
linking shared-object openssl.bundle
linking shared-object ripper.bundle
make: *** [build-ext] Error 2

@Remzi1993
Copy link

Also updated Ruby Build:

Downloading ruby-1.9.3-p194.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/46e2fa80be7efed51bd9cdc529d1fe22ebc7567ee0f91db4ab855438cf4bd8bb
Installing ruby-1.9.3-p194...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/zw/064_dxn92d5czpzx1ckslvzc0000gn/T/ruby-build.20140729173159.16356
Results logged to /var/folders/zw/064_dxn92d5czpzx1ckslvzc0000gn/T/ruby-build.20140729173159.16356.log

Last 10 log lines:
compiling token.c
compiling yaml2byte.c
linking shared-object socket.bundle
ld: warning: directory not found for option '-L/Users/Remzi/.rbenv/versions/1.9.3-p194/lib'
installing default syck libraries
linking shared-object syck.bundle
ld: warning: directory not found for option '-L/Users/Remzi/.rbenv/versions/1.9.3-p194/lib'
linking shared-object ripper.bundle
ld: warning: directory not found for option '-L/Users/Remzi/.rbenv/versions/1.9.3-p194/lib'
make: *** [build-ext] Error 2

@mislav
Copy link
Member

mislav commented Jul 29, 2014

@remzicavdar You might not have a problem with readline, but with openssl. Try brew unlink openssl #542 (comment)

@Remzi1993
Copy link

I have used the OpenSSL installer.
This is a home project I'm working on :)

https://github.com/remzicavdar/OpenSSL-Universal-Binary-Installer

@mislav
Copy link
Member

mislav commented Jul 29, 2014

@remzicavdar OK, then please uninstall it. Many software on OS X like Ruby 1.9 will fail when compiled against newer openssl versions. Openssl that ships with OS X will be just fine for most software, and those Rubies that need the newer one will automatically install it through ruby-build (or re-use the one available in Homebrew)

@Remzi1993
Copy link

#!/usr/bin/env bash
set -x
trap read debug

OPENSSL_VERSION="1.0.1h"

cd /usr/local/src
curl -O http://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz

tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
cd openssl-$OPENSSL_VERSION


sudo ./configure darwin64-x86_64-cc --prefix=/usr/local/openssl-$OPENSSL_VERSION
sudo make
sudo make install


ln -s openssl-$OPENSSL_VERSION /usr/local/openssl


echo 'export PATH=/usr/local/openssl/bin:$PATH' >> ~/.bash_profile
echo 'export MANPATH=/usr/local/openssl/ssl/man:$MANPATH' >> ~/.bash_profile


source ~/.bash_profile


sudo security find-certificate -a -p /Library/Keychains/System.keychain > /usr/local/openssl/ssl/cert.pem

sudo security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> /usr/local/openssl/ssl/cert.pem

cd /usr/local/src
sudo rm openssl-$OPENSSL_VERSION.tar.gz
sudo rm -rf openssl-$OPENSSL_VERSION

@Remzi1993
Copy link

What do I need to uninstall? The latest version of OpenSSL?
I think it's safer and before I installed the latest version of OpenSSL I already got the Build Failed error :(

@Remzi1993
Copy link

| => brew unlink openssl
Unlinking /usr/local/Cellar/openssl/1.0.1h... 0 symlinks removed

It was linked to my version?

@mislav
Copy link
Member

mislav commented Jul 29, 2014

On Tue, Jul 29, 2014 at 8:59 AM, Remzi Cavdar notifications@github.com
wrote:

What do I need to uninstall? The latest version of OpenSSL?
I think it's safer and before I installed the latest version of OpenSSL I
already got the Build Failed error :(

Yes the latest version of OpenSSL. Ruby 1.9 won't compile against it.

It's just a thing to try, though. If it doesn't fix your problem, then it
must be something else.

@Remzi1993
Copy link

Okay, I will try it :)

And if I run brew doctor I get the following warnings :(

| => brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libruby.2.1.0.dylib

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/ruby-2.1.pc
    /usr/local/lib/pkgconfig/ruby-2.2.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
    /usr/local/lib/libruby-static.a
    /usr/local/lib/libruby.2.1.0-static.a

Warning: Some directories in your path end in a slash.
Directories in your path should not end in a slash. This can break other
doctor checks. The following directories should be edited:
    /sw/bin/    /usr/local/    /usr/local/bin/

@Remzi1993
Copy link

Also compiling Ruby from source doesn't work either :(

cd /usr/local/src
git clone git://github.com/ruby/ruby.git
cd ruby
autoconf
./configure
make
make check
sudo make install

sudo rm -rf /usr/local/src/*

I just want to install Ruby, Rails and work on a project, but know I'm really struck :(

@mislav
Copy link
Member

mislav commented Sep 3, 2014

Something seems really broken with your development environment, @remzicavdar. You could try resolving all the issues that brew doctor is complaining about by removing the offending files. You should ensure that the only which -a openssl is /usr/bin/openssl and that it's the system default version ("OpenSSL 0.9.8y"). You should brew install openssl but NOT brew link --force openssl. In the end, try installing only Ruby 2.1.2 and none of the older Ruby versions since they might not be compatible with newest version of libyaml from Homebrew. We're working on fixing compiling old releases.

@mislav
Copy link
Member

mislav commented Sep 3, 2014

Also please reopen new issues about this in the ruby-build project, as this project (rbenv) doesn't deal directly with compiling Ruby versions.

@mislav mislav closed this as completed Sep 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests