RVM - MacPorts的将不通过代理更新(RVM - MacPorts won't

2019-09-02 20:42发布

我试图用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和红宝石: http://d.pr/i/H1Eu

我的OSX - 10.7.4

在此先感谢您的帮助 :)

Answer 1:

虽然曲的评论使人落后代理RVM工作,MacPorts的需要进行更新,以使用代理自动正常工作。

首先,在安装从包装的MacPorts 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注释掉

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

然后通过改变修改.rvm /脚本/功能/需求/ osx_port selfupdatesyncrequirements_osx_port_update_system()函数。

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


Answer 2:

如果你想MAKE MACPORTS WORK BEHIND PROXY ,如何避免port selfupdate

$ 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()

就我而言,它工作正常。



Answer 3:

运行“__rvm_try_sudo端口-dv自更新”通过键盘终端输入密码中,然后重新运行该脚本安装Ruby

它适用于我的笔记本电脑

祝好运



Answer 4:

你需要(重新)先安装命令行工具:

sudo xcode-select --install

然后,更新MacPorts的:

sudo port -v selfupdate

来源: https://stackoverflow.com/a/19634495/226255

然后,你可能会丢失一些要求这么做:

sudo rvm requirements


文章来源: RVM - MacPorts won't update through proxy