2013-07-02 63 views
0

我背後的公司防火牆不會讓我rsync出去,並且需要HTTP/HTTPS代理。我在rvm在這個環境中的macports步驟中遇到了麻煩。代理和防火牆後的Macports/rvm/svn連接問題

總結:

  • 我試圖做rvm install ruby-1.9.3-p286

  • RVM想要使用的MacPorts。

  • macports希望使用rsync進行更新,但我無法rsync。

  • 我設置了一個本地macports源代碼倉庫,但它似乎沒有幫助 - macports仍然希望使用rsync。

  • a similar question的建議建議在rvm的腳本中將port selfupdate更改爲port sync。但這並沒有幫助 - macports然後死試圖做svn update

  • 但我可以手動做svn update罰款,所以我不明白問題在哪裏。


下面是詳細信息:

我跟着this guide使用MacPorts的防火牆後,由當地檢查出的回購,並設置在/opt/local/etc/macports/sources.conf以下。

#rsync://rsync.macports.org/release/tarballs/ports.tar [default] 
    file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ [default] 

我唯一不同於指南的地方是我安裝了10.8的macports而不是10.5。

然而,RVM的MacPorts的似乎仍然使用rsync出於某種原因:

$ rvm install ruby-1.9.3-p286 
Searching for binary rubies, this might take some time. 
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p286. 
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
Installing requirements for osx, might require sudo password. 
Password: 
DEBUG: Copying /Users/tim/Library/Preferences/com.apple.dt.Xcode.plist to 
    /opt/local/var/macports/home/Library/Preferences 
DEBUG: MacPorts sources location: 
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs ---> Updating MacPorts base sources using rsync 
rsync: failed to connect to rsync.macports.org: Connection refused (61) 
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9] 
Command failed: /usr/bin/rsync -rtzv --delete-after  rsync://rsync.macports.org/release/tarballs/base.tar  /opt/local/var/macports/sources/rsync.macports.org/release/tarballs 
Exit code: 10 
DEBUG: Error synchronizing MacPorts sources: command execution failed 
while executing 
"macports::selfupdate [array get global_options] base_updated" 
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed 

這是非常相似的this question,那裏的回答表明了以下變化:

$ diff -u .rvm/scripts/functions/requirements/osx_port.org .rvm/scripts/functions/requirements/osx_port 
--- .rvm/scripts/functions/requirements/osx_port.org 2013-05-28 16:58:37.000000000 +0900 
+++ .rvm/scripts/functions/requirements/osx_port 2013-05-28 16:58:50.000000000 +0900 
@@ -82,7 +82,7 @@ 

requirements_osx_port_update_system() 
{ 
- __rvm_try_sudo port -dv selfupdate || return $? 
+ __rvm_try_sudo port -dv sync || return $? 
} 

requirements_osx_port_define()

不幸的是,結果如下:

$ rvm install ruby-1.9.3-p286 
Searching for binary rubies, this might take some time. 
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p286. 
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
Installing requirements for osx, might require sudo password. 
Password: 
DEBUG: Copying /Users/tim/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences 
---> Updating the ports tree 
Synchronizing local ports tree from file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ 
DEBUG: /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports 
DEBUG: changing euid/egid - current euid: 0 - current egid: 0 
svn: OPTIONS of 'http://svn.macports.org/repository/macports/trunk/dports': could not connect to server (http://svn.macports.org) 
Command failed: /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports 
Exit code: 1 
DEBUG: command execution failed 
    while executing 
"system $svn_commandline" 
Error: Synchronization of the local ports tree failed doing an svn update 
DEBUG: Synchronization of 1 source(s) failed 
    while executing 
"mportsync [array get global_options]" 
port sync failed: Synchronization of 1 source(s) failed 

嘗試直接與MacPorts的:

 
$ port -d sync 
---> Updating the ports tree 
Synchronizing local ports tree from file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ 
DEBUG: /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports 
svn: OPTIONS of 'http://svn.macports.org/repository/macports/trunk/dports': could not connect to server (http://svn.macports.org) 
Command failed: /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports 
Exit code: 1 
DEBUG: command execution failed 
    while executing 
"system $svn_commandline" 
Error: Synchronization of the local ports tree failed doing an svn update 
DEBUG: Synchronization of 1 source(s) failed 
    while executing 
"mportsync [array get global_options]" 
port sync failed: Synchronization of 1 source(s) failed 

這是奇怪的,因爲我可以罰款運行SVN命令:

$ /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports 
At revision 107532. 

這不是一個用戶權限/ profile文件的問題,因爲root可以運行SVN命令也沒關係:

$ sudo /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports 
At revision 107532. 

我假設鏈中沒有正確地看到代理。但是:

  • 我的代理在http_proxyhttps_proxy環境變量設置正確
  • 它還可設置在~/.subversion/servers(如[global]部分變量http-proxy-hosthttp-proxy-port
  • 而且它也是在設置/opt/local/etc/macports/macports.conf(作爲變量proxy_httpproxy_https

其他信息:

  • 紅寶石1.8.7
  • RVM 1.21.4
  • OSX 10.8.3
  • 的MacPorts 2.1.3

讓我知道是否有可能是有用的任何其他信息。

我的問題是我怎樣才能讓port sync在這個環境中工作?(這我希望也將修復rvm

回答

3

的解決方法是讓你去嘗試:

rvm autolbs read-fail 

它不會自動安裝軟件包 - 它會在情況下,失敗的任何包丟失了,並讓你知道這個包的名字,只需用macports手動安裝它們,它應該沒問題。


其他的解決方案將被切換到:

rvm autolibs homebrew 

使用的自制替代的MacPorts,或:

rvm autolibs rvm_pkg 

來檢測一下已經與pkg-config安裝並嘗試安裝休息與舊的rvm pkg install ...。在autolibs


更多細節:http://rvm.io/rvm/autolibs

+0

謝謝!這幫助我解決它。此外,[本頁](http://rvm.io/workflow/proxy)的頂部使得它看起來像rvm正確使用'http_proxy'環境變量,但我還需要在命令行上傳遞它(根據該頁面底部的說明),這是不尋常的。 –

+0

它也可以幫助我。謝謝。 – Awijeet