2014-05-06 3 views
10

Ich möchte gitlab installieren, die nicht empfehlen, Ruby zu verwenden Versionsmanager. Diese Aberkompilieren Ruby 2.0 Fehler ohne rvm oder rbenv, `readline.c: 1886: 26: Fehler: 'Funktion' nicht deklariert (erste Verwendung in dieser Funktion)`

ist mein OS Linux dqa-dev 3.13.0-24-generiC#46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux

linking shared-object psych.so 
installing default psych libraries 
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/psych' 
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/pty' 
compiling pty.c 
pty.c: In function 'chfunc': 
pty.c:143:12: warning: ignoring return value of 'seteuid', declared with attribute warn_unused_result [-Wunused-result] 
    seteuid(getuid()); 
      ^
linking shared-object pty.so 
installing default pty libraries 
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/pty' 
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse' 
compiling cparse.c 
linking shared-object racc/cparse.so 
installing default cparse libraries 
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse' 
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/readline' 
compiling readline.c 
readline.c: In function 'Init_readline': 
readline.c:1886:26: error: 'Function' undeclared (first use in this function) 
    rl_pre_input_hook = (Function *)readline_pre_input_hook; 
         ^
readline.c:1886:26: note: each undeclared identifier is reported only once for each function it appears in 
readline.c:1886:36: error: expected expression before ')' token 
    rl_pre_input_hook = (Function *)readline_pre_input_hook; 
            ^
readline.c: At top level: 
readline.c:530:1: warning: 'readline_pre_input_hook' defined but not used [-Wunused-function] 
readline_pre_input_hook(void) 
^ 
make[2]: *** [readline.o] Error 1 
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/readline' 
make[1]: *** [ext/readline/all] Error 2 
make[1]: Leaving directory `/home/poc/ruby-2.0.0-p451' 
make: *** [build-ext] Error 2 

Antwort

2

Dies ist meine Lösung auf Ubuntu 14.04 Server-Edition.

Ich brauche

sudo apt-get install libreadline6 libreadline6-dev

Dann unterstreichen zu installieren, wurde das Problem behoben.

+3

Dies wäre die sauberere Lösung waren; aber ich benutze die gleiche Version von Ubuntu und diese Pakete sind bereits installiert. Das funktionierte nicht für mich :(Pablos Antwort funktionierte zwar. – nevelis

39

Ich habe auch Ubuntu 14.04 und ich muss es zum Funktionieren bringen. Teilen, was ich getan habe, nur für den Fall, dass es für dich funktioniert.

gepatcht ich die Datei ext/readline/readline.c Linie 1886 ersetzt:

rl_pre_input_hook = (Function *)readline_pre_input_hook; 

Mit

rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook; 

Dann habe ich versucht, es wieder zu machen und es funktionierte.

Quelle: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741825

+4

Danke! Das löste wirklich das Problem. –

+1

danke. Auch es ist wert hinzuzufügen, dass ext-Ordner in Ihrem rvm/rinstallierten Ruby-Versionsordner ist –

3

Ich lief auch in diesem Problem versucht, Ruby-2.0.0-p247 mit Rbenv zu installieren. Sparen Sie Zeit mit this patch.

Sie können es wie folgt aus:

curl -fsSL https://gist.github.com/ference/d3d4cbbe18309a91ad9b/raw/267ea89fa145c536967831e1af4dea030297b53e/ruby-2.0.0-p247.patch | rbenv install --patch 2.0.0-p247 
+0

Dies funktionierte für mich als Charme. – fguillen

Verwandte Themen