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

Can't install on Fedora #443

Closed
caarlos0 opened this issue Oct 29, 2013 · 30 comments
Closed

Can't install on Fedora #443

caarlos0 opened this issue Oct 29, 2013 · 30 comments

Comments

@caarlos0
Copy link

Tried to install ruby 2.0.0-p427 and 1.9.3-p448 on a Fedora Linux, got issues in both and just can't made it work. I also can't install rubinius because it dependes on a ruby 2.0.0 installed.

The error is basically the same:

compiling ossl_x509req.c
installing default readline libraries
linking shared-object readline.so
make[2]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/readline'
make[2]: Entering directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/sdbm'
compiling _sdbm.c
ossl_pkey_ec.c: In function ‘ossl_ec_group_initialize’:
ossl_pkey_ec.c:766:17: warning: implicit declaration of function ‘EC_GF2m_simple_method’ [-Wimplicit-function-declaration]
                 method = EC_GF2m_simple_method();
                 ^
ossl_pkey_ec.c:766:24: warning: assignment makes pointer from integer without a cast [enabled by default]
                 method = EC_GF2m_simple_method();
                        ^
ossl_pkey_ec.c:821:29: error: ‘EC_GROUP_new_curve_GF2m’ undeclared (first use in this function)
                 new_curve = EC_GROUP_new_curve_GF2m;
                             ^
ossl_pkey_ec.c:821:29: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [ossl_pkey_ec.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Entering directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/socket'
generating constant definitions
generating constant definitions
compiling basicsocket.c
compiling init.c
make[2]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
installing default sdbm libraries
compiling socket.c
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
installing default ripper libraries
compiling ipsocket.c
compiling tcpsocket.c
sdbm.so
make[2]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/sdbm'
compiling sockssocket.c
compiling udpsocket.c
compiling unixsocket.c
compiling unixserver.c
compiling option.c
linking shared-object ripper.so
make[2]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/ripper'
compiling ancdata.c
compiling raddrinfo.c
compiling init.c
compiling constants.c
installing default socket libraries
linking shared-object socket.so
make[2]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/socket'
make[1]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247'
make: *** [build-ext] Error 2

BUILD FAILED

Inspect or clean up the working tree at /tmp/ruby-build.20131029140734.31023
Results logged to /tmp/ruby-build.20131029140734.31023.log

Last 10 log lines:
make[2]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/ripper'
compiling ancdata.c
compiling raddrinfo.c
compiling init.c
compiling constants.c
installing default socket libraries
linking shared-object socket.so
make[2]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247/ext/socket'
make[1]: Leaving directory `/tmp/ruby-build.20131029140734.31023/ruby-2.0.0-p247'
make: *** [build-ext] Error 2

My PATH: /usr/local/heroku/bin:./bin:/home/carlos/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/home/carlos/.sfs:/home/carlos/.dotfiles/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/home/carlos/bin:/usr/local/sbin:/usr/sbin:/usr/java/latest/bin:/usr/java/latest/bin:/home/carlos/.rbenv/bin:/opt/node/bin:/opt/node/deps/npm/bin

Not sure what's happening. I believe I have all needed libs installed.

@mislav
Copy link
Member

mislav commented Oct 30, 2013

Thanks for reporting. Turns out this is a known problem with this Ruby version, and needs this patch on Fedora in order to compile: https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff

@hsbt
Copy link
Member

hsbt commented Oct 30, 2013

@caarlos0 It seems ruby-core's issue. Please report our issue tracker http://bugs.ruby-lang.org/ .

@caarlos0
Copy link
Author

@mislav how can I compile with rbenv + ruby-build using that patch?

@mislav
Copy link
Member

mislav commented Oct 30, 2013

@caarlos0 ruby-build unfortunately doesn't offer out-of-the-box way to apply patches. However you can easily hack it.

Create this fedora-configure script. Make it executable!

#!/bin/sh
patch -p0 -i /path/to/patch.diff
exec ./configure "$@"

Then, when building ruby:

RUBY_CONFIGURE=/full/path/to/fedora-configure rbenv install ...

@mislav
Copy link
Member

mislav commented Oct 30, 2013

@caarlos0 Alternative way to the RUBY_CONFIGURE hack:

Create this definition file. It doesn't need to be executable:

before_install_package() {
  case "$1" in
  ruby-* )
    patch -p0 -i /path/to/patch.diff
    ;;
  esac
}

install_package "ruby-2.0.0-p247" "http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz#c351450a0bed670e0f5ca07da3458a5b" standard verify_openssl

Then instruct rbenv install (or ruby-build) to use this definition:

rbenv install my-custom-definition

@caarlos0
Copy link
Author

@mislav, thanks, I just did my script a little different, since I don't have the apply executable:

#!/bin/sh
patch -p0 -i /tmp/patch.diff
exec ./configure "$@"

And it worked as expected!
Thank you very much for your help!

@mislav
Copy link
Member

mislav commented Oct 30, 2013

Oh, do'h! Sorry, I mean't patch as well. Slip of the tongue

@caarlos0
Copy link
Author

No problem, thanks, take this 🍺

@caarlos0
Copy link
Author

Also, RUBY_CONFIGURE seems to be ignored by Rubinius... any idea about how to fix that? (I need to apply a patch that fix a SSL issue in their ./configure script)

Thanks!

@mislav
Copy link
Member

mislav commented Oct 30, 2013

@caarlos0 Then use the 2nd method I described, only make sure you use rubinius-* in the case pattern.

@caarlos0
Copy link
Author

Ohh boy, I tried it but used rbx-*, using rubinius-* worked, but I still get errors while building... but that's another issue, thanks again!

@mislav
Copy link
Member

mislav commented Oct 30, 2013

Please let us know of any issues you manage to sort out. Maybe we can fix some of that, or add to the wiki. Update to latest ruby-build I released last night

@caarlos0
Copy link
Author

Well, I just created an issue rubinius/rubinius#2750

Looks like a weird problem in rubinius... or maybe it's my env..

Thanks!

@injcristianrojas
Copy link

In fact, the only thing that is installable in Fedora right now are the 2.1.0 series.

@ysyfff
Copy link

ysyfff commented Dec 3, 2013

#!/bin/sh
patch -p0 -i /path/to/patch.diff
exec ./configure "$@"

What is the cotent of patch.diff?
cofused!!!!!

@ashumkin
Copy link

ashumkin commented Dec 3, 2013

@ysyfff, see #443 (comment)

@ysyfff
Copy link

ysyfff commented Dec 3, 2013

@ashumkin ,Yes, I've saw it. But what should I do? Copy all of the code into patch.diff? I really do not know how to do next.

@ashumkin
Copy link

ashumkin commented Dec 3, 2013

But what should I do? Copy all of the code into patch.diff?

Yep!
*But it's better not to copy but to save "raw" patch file, to do this see "Export to unified diff" in the right bottom corner of that page or get (that is the same) URL https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff.diff

@ysyfff
Copy link

ysyfff commented Dec 3, 2013

@ashumkin Oh, God! Thanks very much. You give me a big favor!

@kevincobain2000
Copy link

@ryanschwartz Thanks Fixed for me !

mislav added a commit that referenced this issue Dec 11, 2013
If `-p|--patch` flag was set while invoking `ruby-build` or
`rbenv install`, ruby-build will use `patch -p0 -i -` to apply a patch
from stdin to Ruby, Rubinius, or JRuby source code before running the
rest of `build_package_*` commands.

References #443
@mislav
Copy link
Member

mislav commented Dec 20, 2013

Hi everyone,

I just shipped a version of ruby-build that supports the --patch option to easily apply patches from standard input. I've described example usage in the Readme and on the wiki for the Fedora example:

curl -fsSL https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff.diff | \
  rbenv install --patch 2.0.0-p247

@caarlos0
Copy link
Author

Nice one, thanks!

@lzap
Copy link

lzap commented Mar 14, 2014

FYI the patch is gone (404).

@lzap
Copy link

lzap commented Mar 14, 2014

Fixed with:

curl -fsSL https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff?format=diff | filterdiff -x ChangeLog | rbenv install --patch 2.0.0-p247

Note the filterdiff there. Not sure what changed, changelog was busted.

@zenith-777
Copy link

Thank you for all people in this thread, this saved my frustration time installing Ruby-2.0.0-p247 by telling out about the patches 😋
I installed with rvm install ruby-2.0.0-p247 --patch https://bugs.ruby-lang.org/attachments/download/3707/out.patch
And it works like charm 💃
Cheers~! 🍻

@supervacuo
Copy link

For 1.8.7-p375 I needed

$ curl https://bugs.ruby-lang.org/attachments/download/3707/out.patch | filterdiff -x a/test/openssl/test_pkey_ec.rb | rbenv install 1.8.7-p375 --patch

Thanks @ivanelian, @lzap etc.

@quotha
Copy link

quotha commented Feb 4, 2015

@supervacuo thanks!!

@cdcooksey
Copy link

@supervacuo Thanks! That worked great. For anyone else who comes along, this patch also works for 1.8.7-p352:

$ curl https://bugs.ruby-lang.org/attachments/download/3707/out.patch | filterdiff -x a/test/openssl/test_pkey_ec.rb | rbenv install 1.8.7-p352 --patch

For the record, this install worked on CentOS.

@gnodiah
Copy link

gnodiah commented May 12, 2015

Haha...nice guy @supervacuo that is what I wanted. thanks~

ghost pushed a commit to amaysim-au/ruby-build that referenced this issue Oct 29, 2015
fix rbenv#443: add package "1.9.3-p448-fc19" to install Ruby v1.9.3-p448 o…
ghost pushed a commit to amaysim-au/ruby-build that referenced this issue Oct 30, 2015
ghost pushed a commit to amaysim-au/ruby-build that referenced this issue Oct 30, 2015
Apply rbenv#443 patch to build Ruby 2.0.0-p247-amz
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

Successfully merging a pull request may close this issue.