ruby – RVM – MacPorts不会通过代理更新

我正在尝试使用RVM在我的iMac上安装 ruby.

我首先键入以下内容

rvm list kNown

然后,我使用以下行定位我要安装的版本(我正在遵循建议1.9.2而不是基础1.8.7的指南):

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:

我输入密码,我得到了这个:

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但由于落后于代理而失败(或其他什么?)

我试过按照本指南但它不起作用:http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy/

更多的信息:

我当前版本的RVM和RUBY:http://d.pr/i/H1Eu

我的OSX – 10.7.4

在此先感谢您的帮助 :)

解决方法

虽然Koji的评论使RVM在代理服务器之后工作,但Macports也需要更新以自动在代理服务器后面工作.

首先,在http://www.macports.org/install.php从软件包安装macports

然后运行以下命令:

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注释掉

rsync://rsync.macports.org/release/tarballs/ports.tar [default]

使用您喜欢的编辑器,然后在该行下方添加.

file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ [default]

然后运行这些命令以便更新并且不会抱怨您的端口没有被编入索引.

sudo port -d sync
sudo portindex

然后通过在requirements_osx_port_update_system()函数中将selfupdate更改为sync来修改.rvm / scripts / functions / requirements / osx_port.

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

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...