2012-04-03 3 views
1

sudo gem install perftools.rb -p http://10.10.10.10:3128 ...perftools.rb Installation via proxy

/usr/local/lib/ruby/1.9.1/net/http.rb:762:in « initialiser « : Connexion refusée - connect (2) (Errno :: ECONNREFUSED)

...

Demande http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz

Message complet:

sudo gem install perftools.rb -p http://10.249.134.143:3128 
Building native extensions. This could take a while... 
ERROR: Error installing perftools.rb: 
ERROR: Failed to build gem native extension. 

/usr/local/bin/ruby extconf.rb 
(I'm about to compile google-perftools.. this will definitely take a while) 
-- tar zpxvf gperftools-2.0.tar.gz 
-- patch -p1 < ../../../patches/perftools.patch 
-- patch -p1 < ../../../patches/perftools-notests.patch 
-- patch -p1 < ../../../patches/perftools-pprof.patch 
-- patch -p1 < ../../../patches/perftools-gc.patch 
-- patch -p1 < ../../../patches/perftools-debug.patch 
-- patch -p1 < ../../../patches/perftools-objects.patch 
-- patch -p1 < ../../../patches/perftools-frames.patch 
-- patch -p1 < ../../../patches/perftools-realtime.patch 
-- sed -i -e 's,SpinLock,ISpinLock,g' src/*.cc src/*.h src/base/*.cc src/base/*.h 
-- ./configure --disable-heap-profiler --disable-heap-checker --disable-debugalloc --  disable-shared 
-- make 
checking for method.h... no 
checking for vm_core.h... no 
/usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39:  Use RbConfig instead of obsolete and deprecated Config. 
checking for method.h... no 
checking for vm_core.h... no 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
--with-opt-dir 
--with-opt-include 
--without-opt-include=${opt-dir}/include 
--with-opt-lib 
--without-opt-lib=${opt-dir}/lib 
--with-make-prog 
--without-make-prog 
--srcdir=. 
--curdir 
--ruby=/usr/local/bin/ruby 
/usr/local/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection refused -  connect(2) (Errno::ECONNREFUSED) 
from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `open' 
from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `block in connect' 
from /usr/local/lib/ruby/1.9.1/timeout.rb:54:in `timeout' 
from /usr/local/lib/ruby/1.9.1/timeout.rb:99:in `timeout' 
from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `connect' 
from /usr/local/lib/ruby/1.9.1/net/http.rb:755:in `do_start' 
from /usr/local/lib/ruby/1.9.1/net/http.rb:744:in `start' 
from /usr/local/lib/ruby/1.9.1/net/http.rb:1284:in `request' 
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source- 0.1.5/lib/contrib/uri_ext.rb:239:in `block in read' 
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:286:in `connect' 
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:234:in `read' 
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:128:in `download' 
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core' 
from /usr/local/lib/ruby/1.9.1/tempfile.rb:316:in `open' 
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core' 
from extconf.rb:104:in `<main>' 
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz 


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/perftools.rb-2.0.0 for inspection. 
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/perftools.rb-2.0.0/ext/gem_make.out 

Il semble que la compilation à partir de sources nécessite des sources ruby ​​et il essaie de le télécharger directement depuis le site de Ruby. Comment puis-je installer perftools.rb via un proxy http?

+0

Merci d'avoir essayé de rendre plus lisible la question, mais pouvez-vous poster l'ensemble des messages, ainsi que le résumé que vous avez actuellement? –

+0

Andrew, le message est ajouté – shevchyk

Répondre

0

Il s'est avéré que gem ruby_core_source ne lit pas correctement la variable http_proxy sur ma boîte ubuntu. Je l'ai téléchargé le fichier tar.gz à partir du site rubis et changer un peu 1.9.1/gemmes/ruby_core_source-0.1.5/lib/ruby_core_source.rb:

53: temp.binmode 
54: uri = URI.parse(uri_path) 
55: #uri.download(temp) 
57: 
58: tgz = Zlib::GzipReader.new(File.open("/home/dir/ruby-1.9.3-p125.tar.gz",  "rb")) 
59: 
60: FileUtils.mkdir_p(dest_dir) 
61: Dir.mktmpdir { |dir| 
62: inc_dir = dir + "/" + ruby_dir + "/*.inc" 
63: hdr_dir = dir + "/" + ruby_dir + "/*.h" 
64: Archive::Tar::Minitar.unpack(tgz, dir) 
65: FileUtils.cp(Dir.glob([ inc_dir, hdr_dir ]), dest_dir) 
66: } 
67:}