mark-moseley / ruby_core_source

Retrieve ruby core source files
BSD 2-Clause "Simplified" License
21 stars 39 forks source link

proxy support… #6

Open victornoel opened 13 years ago

victornoel commented 13 years ago

Hello,

I am trying to use a gem that needs your gem, but I am blocked because I use a proxy and it seems that to download http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.gz your gem does not follow the proxy used by "gems install".

[victor@volte src]$ gem install linecache19 -p http://proxy.irit.fr:8001 Building native extensions. This could take a while... ERROR: Error installing linecache19: ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb checking for vm_core.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 --without-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/bin/ruby --with-ruby-dir --without-ruby-dir --with-ruby-include --without-ruby-include=${ruby-dir}/include --with-ruby-lib --without-ruby-lib=${ruby-dir}/lib /usr/lib/ruby/1.9.1/net/http.rb:644:in initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT) from /usr/lib/ruby/1.9.1/net/http.rb:644:inopen' from /usr/lib/ruby/1.9.1/net/http.rb:644:in block in connect' from /usr/lib/ruby/1.9.1/timeout.rb:44:intimeout' from /usr/lib/ruby/1.9.1/timeout.rb:87:in timeout' from /usr/lib/ruby/1.9.1/net/http.rb:644:inconnect' from /usr/lib/ruby/1.9.1/net/http.rb:637:in do_start' from /usr/lib/ruby/1.9.1/net/http.rb:626:instart' from /usr/lib/ruby/1.9.1/net/http.rb:1160:in request' from /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:239:inblock in read' from /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:286:in connect' from /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:234:inread' from /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:128:in download' from /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:55:inblock in create_makefile_with_core' from /usr/lib/ruby/1.9.1/tempfile.rb:320:in open' from /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:51:increate_makefile_with_core' from extconf.rb:20:in `

' Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.gz

Gem files will remain installed in /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/linecache19-0.5.11 for inspection. Results logged to /home/victor/code/pkgbuild/diaspora-git/src/diaspora-gems/gems/linecache19-0.5.11/ext/trace_nums/gem_make.out

fnando commented 13 years ago

+1 for this fix... we're trying to install ruby-debug19 in our CI server that's behind a proxy, but we have to do it by hand. :(

fnando commented 13 years ago

Reading the source code, I made it work by copying the ruby source (ruby-1.9.2-p0 directory) to /var/lib/hudson/jobs/nephelae# ls /opt/ruby/1.9.2-p0/include/ruby-1.9.1/ruby-1.9.2-p0, where our ruby installation lives.

liyuray commented 13 years ago

Seems that ruby_core_source only recognize HTTP_PROXY environment variable in upper case. "http_proxy" is not recognized.

avalez commented 12 years ago

It's also necessary to add HTTP_PROXY to /etc/sudoers env_keep list, if you do 'sudo gem install'