我背后的公司防火墙不会让我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_proxy
和https_proxy
环境变量设置正确 - 它还可设置在
~/.subversion/servers
(如[global]
部分变量http-proxy-host
和http-proxy-port
) - 而且它也是在设置
/opt/local/etc/macports/macports.conf
(作为变量proxy_http
和proxy_https
)
其他信息:
周- 红宝石1.8.7
- RVM 1.21.4
- OSX 10.8.3
- 的MacPorts 2.1.3
让我知道是否有可能是有用的任何其他信息。
我的问题是我怎样才能让port sync
在这个环境中工作?(这我希望也将修复rvm
)
谢谢!这帮助我解决它。此外,[本页](http://rvm.io/workflow/proxy)的顶部使得它看起来像rvm正确使用'http_proxy'环境变量,但我还需要在命令行上传递它(根据该页面底部的说明),这是不寻常的。 –
它也可以帮助我。谢谢。 – Awijeet