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

The Ruby readline extension was not compiled. #1076

Closed
silviali opened this issue Apr 16, 2017 · 6 comments
Closed

The Ruby readline extension was not compiled. #1076

silviali opened this issue Apr 16, 2017 · 6 comments

Comments

@silviali
Copy link

silviali commented Apr 16, 2017

I'm new with the whole ruby and rbenv...
I was trying to install doing rbenv install 2.4.1
But get the following.
Did RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 2.4.1 and a few other things suggested in other post but to no avail... Please help.

ruby-build: use openssl from homebrew
Downloading ruby-2.4.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.bz2
Installing ruby-2.4.1...
ruby-build: use readline from homebrew
BUILD FAILED (OS X 10.12.4 using ruby-build 20170322)

Inspect or clean up the working tree at /var/folders/xq/zvy8gy656y155stcbh4gpzxr0000gp/T/ruby-build.20170416153259.57281
Results logged to /var/folders/xq/zvy8gy656y155stcbh4gpzxr0000gp/T/ruby-build.20170416153259.57281.log

Last 10 log lines:
The Ruby readline extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
  --prefix=/Users/silviali/.rbenv/versions/2.4.1
  --with-openssl-dir=/usr/local/opt/openssl
  --with-readline-dir=/usr/local/Cellar/readline/7.0.3_1
  CC=clang
  CFLAGS= -O3 -Wno-error=shorten-64-to-32 
  LDFLAGS=-L/Users/silviali/.rbenv/versions/2.4.1/lib 
  CPPFLAGS=-I/Users/silviali/.rbenv/versions/2.4.1/include 
@robmaurizi
Copy link

You may need to link readline... That appeared to be my issue.

Try brew install readline. When I ran that, it told me that readline was installed, but wasn't linked.

@nruth
Copy link

nruth commented Apr 30, 2018

Did you install readline before building? It works for me on 10.13 (and previous versions) using the RUBY_CONFIGURE_OPTS snippet in the above post, though mine is in my shell profile rc file. I haven't needed to force-link readline for this to work.

@tesssie
Copy link

tesssie commented Feb 6, 2019

needed to do brew link readline --force

@mislav
Copy link
Member

mislav commented Feb 12, 2019

It should not be necessary to brew link readline --force. ruby-build will automatically link against Homebrew-installed readline even if readline itself wasn't globally "linked". Doing brew link readline --force can hurt installations of other software and that is exactly why Homebrew doesn't do it by default and discourages doing it entirely.

@icedtrees
Copy link

icedtrees commented Mar 5, 2019

Is it feasible to require brew readline as a hard dependency on OSX? I feel like it would save a bunch of developer time from people running into this issue and having to look it up and figure out why it isn't working.

@mislav
Copy link
Member

mislav commented Nov 2, 2019

We automatically use readline from Homebrew whenever available.

ruby-build/bin/ruby-build

Lines 1010 to 1015 in f6e8dc1

use_homebrew_readline() {
if [[ "$RUBY_CONFIGURE_OPTS" != *--with-readline-dir=* ]]; then
local libdir="$(brew --prefix readline 2>/dev/null || true)"
if [ -d "$libdir" ]; then
echo "ruby-build: using readline from homebrew"
package_option ruby configure --with-readline-dir="$libdir"

@mislav mislav closed this as completed Nov 2, 2019
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

6 participants