Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

brew install ruby fails on readline.c #13046

Closed
slarew opened this issue Jun 26, 2012 · 9 comments
Closed

brew install ruby fails on readline.c #13046

slarew opened this issue Jun 26, 2012 · 9 comments

Comments

@slarew
Copy link
Contributor

slarew commented Jun 26, 2012

logs: https://gist.github.com/2999835
brew doctor checked out fine.

I can't seem to figure out what might be wrong. I ran brew install --with-doc ruby on my other mac just about a week ago and it compiled fine. Now, I can't install ruby using brew. It seems that readline (vs. libedit) is a common problem when installing ruby but I'm too new to homebrew to fix this issue.

compiling readline.c
...
readline.c:1499:9: error: use of undeclared identifier
      'username_completion_function'; did you mean
      'rl_username_completion_function'?
                                    rl_username_completion_function);
                                    ^
readline.c:69:42: note: expanded from macro 'rl_username_completion_function'
# define rl_username_completion_function username_completion_function
                                         ^
/usr/local/Cellar/readline/6.2.2/include/readline/readline.h:449:14: note: 
      'rl_username_completion_function' declared here
extern char *rl_username_completion_function PARAMS((const char *, int));
             ^
1 error generated.
make[2]: *** [readline.o] Error 1
@jeffstyr
Copy link
Contributor

I ran into this today too, and I'm pretty sure the issue is that the CFLAGS environment variable is missing -I/usr/local/Cellar/readline/6.2.2/include (CPPFLAGS has it, but not CFLAGS). I'm not sure of the right way to fix this; manually passing it to configure in the formula would probably work, but I'd imagine there's a better fix. I can't figure out how it's getting set in CPPFLAGS -- I think that's probably the key.

@slarew
Copy link
Contributor Author

slarew commented Jun 27, 2012

OK I'm glad to hear I'm not the only one with the problem. You're correct about CFLAGS. I noticed that too and thought it might be the possible problem. However, I'm too new to homebrew to know they proper way to fix it!

@jeffstyr
Copy link
Contributor

Thinking about it more I'm not sure if CFLAGS should need that, I'll have to do some more experimenting tomorrow. But it's not just you. Also my case is on Snow Leopard, so just about everything in the tool chain is different, but it's complaining about the same thing, so I think it's a configuration problem of some sort.

@damnhandy
Copy link

I'm running into the same issues as well when trying to install on a new OS X Lion VM. Interestingly, this worked fine on my MacBook Pro which is also running Lion. That was about 2 months ago and it seemed to work without a hitch. Doing it on a clean machine isn't going quite so well.

@2bits
Copy link
Contributor

2bits commented Jun 27, 2012

@samueljohn @jacknagel This builds okay in my branch that has #13037 pulled into it.

@adamv
Copy link
Contributor

adamv commented Jun 27, 2012

Please brew update and retry without this patch; #13037 has been pulled and should address this issue.

@adamv adamv closed this as completed Jun 27, 2012
@slarew
Copy link
Contributor Author

slarew commented Jun 27, 2012

I brew update and brew install --with-doc ruby worked. Thanks.

@tlberglund
Copy link

I have run brew update just today, and I still see the same problem. Would it be best for me to open a new issue linking to gists of my brew --config, the install output, etc?

@2bits
Copy link
Contributor

2bits commented Jul 5, 2012

yes please

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants