-
Notifications
You must be signed in to change notification settings - Fork 785
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
Build failure on 2.x and solution (related to readline) #526
Comments
I already requested to support readline-6.3 to ruby-core. this issue isn't ruby-build issue. |
Are you serious closing the issue like that? Yes it is a ruby-build issue! I would have expected you would help users to actually succeed with ruby-build as it is NOT possible to build on many systems RIGHT NOW. I burnt a lot of time figuring out how to get it to work and no doubt others just give up and you never hear about it. A simple heads up in your readme as you do for Mac would save people a lot of time for a current problem using your tool to achieve the goal of building ruby. It sounds like you would rather have users waste their time scratching their heads. Why then would I use ruby-build? Where is the value add? Yes I can see there is a patch on trunk which may help with a particular readline issue but that doesn't help me or others use ruby-build to get a functioning ruby 2.0.x or 2.1.x today. |
@ahacking I’d like to offer you a 100% refund for your troubles.
To answer your question directly: the value that |
@ahacking This patch would be a welcome addition. Thank you for volunteering to contribute it. |
I've done all I'm going to do, if you can't be bothered to paste my I won't be using ruby-build moving forward as there is no value in it I use like to use tools that actually give me something.
|
@hsbt I want to explore if it's possible that ruby-build works around this issue by specifying @ahacking Sorry you lost time over this. I've lost time trying to get Rubies to build on systems I'm not familiar myself, and I know how it sucks and I would rather that somebody solves it for me. The truth is, we don't have excellent support for Fedora and Arch right now since Ruby build scripts have subtle bugs on them, and ruby-build is essentially a thin wrapper around We are not able to solve all compile problems, but if there's a possibility to work around annoyances, I would like to explore that like we did with openssl issues on Mac. |
Nice of you to add the caveat. It still seems that it might be possible to detect the case and add the flag ourselves, but I'm waiting for @hsbt for advice. |
@ahacking At first, I'm sorry to close before your response. @mislav @sferik RUBY_CONFIGURE_OPTS workaround looks wrong to me. This issue caused by header file. Therefore, Addition of "--with-readline-dir=/usr/lib/libreadline.so" cann't solve this issue. I think this case skipped build to readline extension. And, I think this issue should be solved by upstream. It's most efficient solution by alternative tools like rvm, ruby-install. |
Thanks for looking into it. I can't verify if readline actually built or not as I don't have the system image anymore. Its highly probable like you say that it just caused building of readline to be skipped. I will investigate more closely a bit later today when I bootstrap a new system image. I will also see what the Arch package script for ruby 2.1.1 does. I just prefer to sandbox everything I do and not rely on system rubies or gems ever. I did try setting --with-readline-dir=/usr/include/readline as one attempt to get things building but that didn't work either (I'm not entirely sure without further digging what that option is expecting). No doubt ruby is busted as per the patch on their trunk and there is probably not much getting around it other than using the patched source, or manually applying the patch to release 2.1.1 or waiting for upstream patch release. Since I am not close to this, does anyone have any idea on when we would expect the ruby team to release a 2.1.1pX release incorporating the readline build fix? |
Because of ongoing issues like these, I'm beginning to think that we should ship some basic patches with ruby-build to make current releases of Ruby actually compile on different systems, a la RVM. A future release of Ruby might tackle this issue, but anyone who tries to install Ruby 2.1.1 on Arch in the future will be greeted with the same failure. Same for Fedora: #443 |
I didn't want to suggest that but yes I think tools like ruby-build should I am surprised the readline issue slipped through the ruby team. Do they
|
@ahacking We fixed this issue immediately in trunk when released readline-6.3 on Gentoo and Arch Linux. If you can't wait to release of next stable package and build 2.1.1 with original patch, We have no idea to fix your issue. |
@hsbt I don't have issue with patching and building ruby and I am not complaining about the responsiveness of the readline fix. But there is always room to improve the breadth of the testing given the success of ruby and the number of platforms it gets deployed on. I do agree with @mislav that ruby-build could smooth over any rough edges if it shipped with patches for these kinds of problems. Ideally ruby-build should "just work" and it would be beneficial to have the ability within ruby-build to deal with any short term issues that arise like readline by applying patches. |
This reverts commit 6cf348e. See #526 (comment).
I'm also on archlinux. Using the patches below I managed to build 2.0.0-p451 and 2.1.1. I used this patch for 2.0.0-p451:
And this one for 2.1.1 (from archlinux package repository):
Build with |
Here is the 2.1.1 patch I ported from Ruby trunk: https://gist.github.com/mislav/a18b9d7f0dc5b9efc162 Usage: curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1 Patches by @EdVanDance might also work; I haven't tried. |
Confirmed this works for me on Arch 3.13. Thankyou! I guess the readme now needs to be updated.
|
@ahacking Patches welcome! |
Troubleshooting instructions for some Ruby version + OS version combinations and tips for workarounds should go to the wiki, not the Readme, so they can be updated and adjusted outside of git. |
@mislav Thanks for your patch. It worked for me on Xubuntu 14.04. |
Thanks, it works in Debian unstable too. Do i understand correctly, that the patch for this is only in the 2.2.0-dev for now and will be merged to 2.1.1 later? (https://github.com/ruby/ruby/tree/ruby_2_1 ends with backport 9299 and this is 9630) |
I had the same issue on Ubuntu 14.04. |
Downgrade to readline 6.2.4 worked for me on MacOS Mavericks. This solution seems like the cleanest fix for now until the code is updated. |
Instead of downgrading to 6.2.4 I did the following:
Install Ruby 2.1.1 |
Patch worked on Ubuntu 14.04 LTS when compiling Ruby 2.1.1 via rbenv install:
thanks @mislav |
great stuff, fixed in 2.0.0-p481 |
2.0.0-p481 and 2.1.2 is released. Please update latest version of ruby-build, and build above version of Ruby. |
👯 about time! Thank Ruby core devs and @mislav and everyone :) |
This worked for me on Ubuntu 14.04.. I had to locate sudo find / -name 'libreadline.so' It was
as suggested by @ahacking and it worked. However, this only helps in installing ruby, but the installed ruby does not have readline support. Thus I got this error, when trying to start the console: ``require': cannot load such file -- readline (LoadError) Finally, I did what @mislav suggested: curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1 and everything worked. |
Unfortunately, I'm forced to switch to So, I believe the best solution in the thread is of @mislav, if I'm not missing anything. It works for One thing that might come to mind is why not just use It might make sense to describe briefly how to match those revisions with commits. In order to search for a corresponding commit I did this, for example:
The output was like:
As you can see, we have the revision in
Which is on the Now then, we're interested in revisions
But I had yet several more things to do down the road:
So it didn't get the patch level. On a side note, the patch is applied here. So, you can add some debugging statements to be able to experiment with applying a patch, like these ones:
Moving on, my next attempt was as follows:
Now, the second patch didn't apply:
Apparently, there were some changes introduced between 2.0.0-p247 and
So, my next and last attempt was as follows:
Pretty "ssh public key"-like solution, huh? :) Not sure if that's all to be done, but at least it installs. Couple of suggestions for developers. It makes sense to describe how to search for and apply patches for people to be able to do it themselves, unless |
Thanks for the tips @x-yuri. Sorry you had so much trouble applying a couple of patches. The thing is, ruby-build will detect and automatically instruct Because these patches have the prefixes but seem to be saved without the |
Apply mislav's patch rbenv/ruby-build#526 (comment) against a readline bug in newer rubies. Should fix thoughtbot#219 and thoughtbot#218, and we'll remove when a new ruby is released or if ruby-build patches this bug itself.
Ref: rbenv/ruby-build#526 Signed-off-by: Jeroen van Baarsen <[email protected]>
Digital Ocean Ubuntu 140.04. 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux The patch method suggested for 2.1.1 and other versions worked for me.
|
Apply mislav's patch rbenv/ruby-build#526 (comment) against a readline bug in newer rubies. Should fix thoughtbot#219 and thoughtbot#218, and we'll remove when a new ruby is released or if ruby-build patches this bug itself.
Ref: rbenv/ruby-build#526 Signed-off-by: Jeroen van Baarsen <[email protected]>
If you just want to get Ruby 2.0.0-p353 working without upgrading the patch version have a look here: #587 (comment). |
It seems recent versions of ruby (2.x) have a hard time with readline and fail to build on many systems. The error typically being:
While it looks like openssl error upon viewing the build log the actual culprit is readline:
I found the following allows ruby 2.0 variants including 2.1.0 and 2.1.1 to build successfully:
The above worked on Arch Linux and likely works on many systems with readline installed in
/usr/lib/libreadline.so
and more generally/some/prefix/libreadline.so
Perhaps you can update the README to cover this error and the solution because there was precious little information on overcoming this problem that I could find.
The text was updated successfully, but these errors were encountered: