2014-04-28 13 views
5

Sono sulla traccia Ruby e sono nel processo di installazione di Ruby on Rails.Impossibile installare gems perché "metodo non definito` invoke_with_build_args 'per nil: NilClass "

Sto cercando di installare gemme ma non sta succedendo e non sono sicuro del perché e come risolverlo.

$gem install bundler 

ERROR: Loading command: install (LoadError) 
dlopen(/Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64- darwin13.0/openssl.bundle, 9): Library not loaded:  /usr/local/opt/openssl/lib/libssl.1.0.0.dylib 
    Referenced from: /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64- darwin13.0/openssl.bundle 
    Reason: image not found -  /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle 
ERROR: While executing gem ... (NoMethodError) 
undefined method `invoke_with_build_args' for nil:NilClass 

Ecco una delle soluzioni che ho provato:

$CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl" rbenv install 2.1.1 

rbenv: /Users/nthulanemakgato/.rbenv/versions/2.1.1 already exists 
continue with installation? (y/N) y 
Downloading yaml-0.1.6.tar.gz... 
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e 
Installing yaml-0.1.6... 

BUILD FAILED 

Inspect or clean up the working tree at  /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby- build.20140429120202.53716.log 

Last 10 log lines: 
x yaml-0.1.6/win32/vc6/test_reader.dsp 
x yaml-0.1.6/win32/vc6/run_loader.dsp 
x yaml-0.1.6/win32/vc6/run_parser.dsp 
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp 
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp 
x yaml-0.1.6/win32/vc6/libyaml.dsw 
x yaml-0.1.6/win32/vc6/yaml.dsp 
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml- 0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~ 
configure: WARNING: unrecognized options: --with-openssl-dir 
configure: error: expected an absolute directory name for --prefix: openssl 

BUILD FAILED 

Inspect or clean up the working tree at  /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby- build.20140429120202.53716.log 

Last 10 log lines: 
x yaml-0.1.6/win32/vc6/run_loader.dsp 
x yaml-0.1.6/win32/vc6/run_parser.dsp 
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp 
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp 
x yaml-0.1.6/win32/vc6/libyaml.dsw 
x yaml-0.1.6/win32/vc6/yaml.dsp 
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml-  0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~ 
configure: WARNING: unrecognized options: --with-openssl-dir 
configure: error: expected an absolute directory name for --prefix: openssl 
make: *** No targets specified and no makefile found. Stop. 

ho openssl-1.0.1g installato

sto usando Mac 10.9.2
rubino 2.1 .1p76 (2014/02/24 revisione 45161) [x86_64-darwin13.0]
rbenv 0.4.0-97-gfe0b243

Questo non è come altre domande in quanto sto usando rbenv mentre altri chiedono domande relative a rvm che non posso usare.

Grazie in anticipo.

+0

'libreria non caricato:/usr/local/opt/openssl/lib ...' << ti manca OpenSSL. Il [rbenv wiki] (https://github.com/sstephenson/ruby-build/wiki) fornisce le istruzioni per installarlo –

+0

@ user2062950 Ho appena aggiunto che ho installato openssl. Ma le indicazioni nel link che hai condiviso sono per Ruby 1.9.3p-0 o inferiore e il mio è 2.1.1. – Coolkid

+0

hai capito questo fuori @Coolkid? – Magne

risposta

4

Sembra che sia necessario installare prima OpenSSL. Quindi cercate di installarlo:

$ birra installare openssl

e quindi è necessario ricompilare rubino con OpenSSL:

$ CONFIGURE_OPTS = "- con-openssl-dir = brew --prefix openssl "rbenv install 2.1.1-p76

+0

Ho installato 'openssl-1.0.1g'. Quando provo la tua seconda riga di codice e dice 'ruby-build: definizione non trovata: 2.1.1-p76 Puoi elencare tutte le versioni disponibili con 'rbenv install --list'' anche se la versione è già installata . – Coolkid

+0

Eseguire 'rbenv install --list' e selezionare una delle versioni disponibili. Quindi cambia la mia seconda linea in: '$ CONFIGURE_OPTS = "- con-openssl-dir = brew --prefix openssl" rbenv install *** qui la tua versione ***' – iSunRise

+0

per favore guarda il post aggiornato. – Coolkid

5

Ho scoperto che anche se avevo già installato openSSL avevo bisogno di t o brew upgrade ruby prima che venisse riconosciuto. Un altro labirinto di piccoli passaggi tortuosi, tutti uguali.

-1

tenta di utilizzare questo codice in cmd

chcp 1252 
Problemi correlati