2015-07-28 20 views
8

Ho usato Warbler per creare un file Jar dalla mia sorgente Ruby. Ho anche installato RVM. Il comportamento del vaso varia a seconda che Rubino versione RVM sta usando: se io rvm use jruby poi il vaso funziona normalmente, ma se io rvm use 2.2 poi eseguire le stampe vaso questi messaggi di avviso alla console:Come smettere di RVM interferendo con JRuby

Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2 
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7 

e se io rvm use ruby-1.9.3-p484 poi eseguire il vaso non riesce in realtà:

Ignoring unf_ext-0.0.7.1 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.1 
Ignoring nokogiri-1.6.2.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.2.1 
Ignoring nokogiri-1.6.6.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.6.2 
Ignoring nokogiri-1.6.6.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.6.2 
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2 
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7 
Ignoring nokogiri-1.6.2.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.2.1 
Ignoring unf_ext-0.0.7.1 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.1 
NameError: uninitialized constant Nokogiri::XERCES_VERSION 
const_missing at org/jruby/RubyModule.java:2733 
     to_hash at /vagrant/myproject!/gems/nokogiri-1.6.6.2-java/lib/nokogiri/version.rb:73 
     ... 

Se eseguo il barattolo sul computer senza rvm installato, funziona benissimo.

Che cosa sta causando questo e come posso impedire a RVM di interferire con il mio contenitore?

+0

forse dovresti provare rbenv https://github.com/sstephenson/rbenv – nisevi

risposta

2

non è semplicemente RVM da incolpare, l'installazione di sistema di Ruby potrebbe aver interferito anche ... Disattivare le variabili di ambiente GEM_HOME e GEM_PATH in modo che non vengano utilizzate.

se si tratta di un .war si può anche provare a isolare completamente l'embed JRuby per iniziare un tempo di esecuzione di Ruby con un'ENV vuoto utilizzando jruby.runtime.env=false proprietà di sistema (o il parametro app contesto init)

per gli archivi .jar confezionati utilizzano config.override_gem_home (dovrebbe funzionare anche con .war)

+0

Unsetting GEM_PATH ha funzionato! Non è un .war quindi non posso usare 'jruby.runtime.env'. Sai se esiste qualche opzione di configurazione per impedire al jar di tentare di utilizzare la variabile d'ambiente GEM_PATH? – fblundun

+0

@fblundun si ... ha aggiornato la risposta con 'config.override_gem_home' – kares