Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Can't install on Fedora #443

Closed
caarlos0 opened this Issue · 29 comments
@caarlos0

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
Collaborator

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
Collaborator

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

@caarlos0

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

@mislav
Collaborator

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

@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

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

@caarlos0 caarlos0 closed this
@mislav
Collaborator

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

@caarlos0

No problem, thanks, take this :beer:

@caarlos0

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
Collaborator

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

@caarlos0

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
Collaborator
@caarlos0

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

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

Thanks!

@ashumkin ashumkin referenced this issue from a commit in ashumkin/ruby-build
@ashumkin ashumkin fix #443: add package "1.9.3-p448-fc19" to install Ruby v1.9.3-p448 o…
…n Fedora 19

This packages patches ruby sources with
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41808/diff
before compiling.

See sstephenson#443
c435f15
@injcristianrojas

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

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

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

@ysyfff

@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

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

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

@kevincobain2000

@ryanschwartz Thanks Fixed for me !

@mislav mislav referenced this issue from a commit
@mislav mislav Add `--patch` flag to apply a Ruby patch from stdin
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
4351c46
@mislav
Collaborator

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

Nice one, thanks!

@lzap

FYI the patch is gone (404).

@lzap

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

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 :yum:

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 :dancer:
Cheers~! :beers:

@supervacuo

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

@supervacuo thanks!!

@cdcooksey

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

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.