无法更改 RVM 默认值 [英] Can't change RVM default

查看:47
本文介绍了无法更改 RVM 默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更改默认 ruby​​ 时遇到问题.运行 OS X Lion.

I have problem changing the default ruby. Running OS X Lion.

macbook:~ work$ rvm list
rvm rubies

=* ruby-1.9.2-p290 [ x86_64 ]
   ruby-1.9.2-p318 [ x86_64 ]

如您所见,1.9.2-p290 是默认值.

As you can see, 1.9.2-p290 is the default.

macbook:~ work$ rvm use --default ruby-1.9.2-p318
Using /usr/local/rvm/gems/ruby-1.9.2-p318
macbook:~ work$ rvm list

rvm rubies

* ruby-1.9.2-p290 [ x86_64 ]
=> ruby-1.9.2-p318 [ x86_64 ]

运行 rvm use --default ruby​​-1.9.2-p318 后,Ruby 变了,但默认仍然是 p290.下次我重新打开shell时,使用的ruby是p290.

After running rvm use --default ruby-1.9.2-p318, the Ruby changed, but default is still p290. And the next time I reopen a shell, the ruby used is p290.

有什么想法吗?

谢谢.

推荐答案

您有多用户安装,但我也提供用户安装的信息/说明.

You have multi-user installation, but I provide also information/instructions for user installation.

多用户安装使用/etc/profile.d/rvm.sh - 每次生成任何 shell 时都会获取此文件,这包括登录时,您所做的任何事情都已经在加载的早期默认值的上下文中工作.

Multi-user installations use /etc/profile.d/rvm.sh - this file is sourced every time any shell is spawned, this includes when you login, anything you do is already working in context of the loaded earlier default.

您需要重新启动计算机才能生效.

You need to restart computer for this to make effect.

您需要更新您的 .*rc 配置文件以使 --default 生效:

you need to update your .*rc configuration files for --default to take effect:

rvm get stable --auto

并重新启动您的计算机.

and restart your computer.

需要重新启动,因为在登录之前/登录时加载了较早的默认值,使用更新的配置文件,加载点移动到正确的位置,更改默认值应该不会再有问题.

Restart is required because the earlier default was loaded before/while logging in, with the updated config files the loading point moves to proper place and there should be no more problems with changing default.

当 RVM 用作 $rvm_path/bin/rvm 的二进制文件时,它无法设置 --default,因为它绑定到 use 并且 use 在脚本模式下不起作用,您可以使用以下命令来管理默认值:

When RVM is used as binary from $rvm_path/bin/rvm it can not set --default as it's bound to use and use is not working in scripting mode, you can use following commands to manage default:

rvm alias delete default 
rvm alias create default 1.9.3

并使其生效(替换rvm use default):

source $(rvm default do rvm env --path)

这篇关于无法更改 RVM 默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆