RVM - MacPorts 不会通过代理更新 [英] RVM - MacPorts won't update through proxy
问题描述
我正在尝试使用 RVM 在我的 iMac 上安装 ruby.
I'm trying to use RVM to install ruby on my iMac.
我首先输入以下内容:
rvm list known
然后我使用以下行定位我想要安装的版本(我遵循的指南推荐 1.9.2 而不是基本的 1.8.7):
I then target the version that I want to install (the guide I'm following recommends 1.9.2 instead of the base 1.8.7) with the following line:
rvm install 1.9.2
然后我明白了:
27698AM:~ butler15$ rvm install 1.9.2
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-1.9.2-p320.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Password:
我输入我的密码,我得到了这个:
I enter my password and I get this:
DEBUG: Copying /Users/butler15/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: Operation timed out (60)
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
如果我理解正确,它正在尝试更新 MacPorts,但由于位于代理(或其他什么?)后面而失败
If I understand correctly it's trying to update MacPorts but fails due to being behind a proxy (or something?)
我已尝试遵循本指南,但没有奏效:http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy/
I've tried following this guide but it didn't work: http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy/
更多信息:
我当前的 RVM 和 RUBY 版本:http://d.pr/i/H1Eu
My current version of RVM and RUBY: http://d.pr/i/H1Eu
我的 OSX - 10.7.4
My OSX - 10.7.4
预先感谢您的帮助:)
推荐答案
虽然 Koji 的评论使 RVM 在代理后工作,但 Macports 需要更新以自动在代理后工作.
While Koji's comment makes RVM work behind a proxy, Macports will need to be updated to automatically work behind a proxy as well.
首先,从 http://www.macports.org/install.php
然后运行以下命令:
sudo mkdir -p /opt/local/var/macports/sources/svn.macports.org/trunk/dports/
cd /opt/local/var/macports/sources/svn.macports.org/trunk/dports/
sudo svn co http://svn.macports.org/repository/macports/trunk/dports/ .
在/opt/local/etc/macports/sources.conf中注释掉
In /opt/local/etc/macports/sources.conf comment out
rsync://rsync.macports.org/release/tarballs/ports.tar [default]
使用您最喜欢的编辑器,然后在该行下方添加此内容.
with your favorite editor and then add this right below that line.
file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ [default]
然后运行这些命令,以便它进行更新并且不会抱怨您的端口未编入索引.
And then run these commands so that it updates and doesn't complain about your ports not being indexed.
sudo port -d sync
sudo portindex
然后通过将requirements_osx_port_update_system()
函数中的selfupdate
更改为sync
来修改.rvm/scripts/functions/requirements/osx_port.>
Then modify .rvm/scripts/functions/requirements/osx_port by changing selfupdate
to sync
in the requirements_osx_port_update_system()
function.
requirements_osx_port_update_system()
{
#__rvm_try_sudo port -dv selfupdate || return $?
__rvm_try_sudo port -dv sync || return $?
}
这篇关于RVM - MacPorts 不会通过代理更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!