如何使用rvm和ree更新rubygems ?

时间:2022-12-14 07:14:28

How do you update rubygems under rvm when ree is your default vm (on Snow Leopard)? I am doing:

当ree是默认的vm(在雪豹上)时,如何在rvm下更新rubygems ?我做的事情:

$ rvm ree gem update --system

This results in things looking like everything went fine:

这导致一切看起来都很顺利:

Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.7
Updating RubyGems to 1.3.7
Installing RubyGems 1.3.7
RubyGems 1.3.7 installed

[...]

RubyGems installed the following executables:
        /Users/douglassellers/.rvm/rubies/ree-1.8.7-2010.02/bin/gem

but when I run gem --version it still says 1.3.5. Doing a which gem points at ree version of gem.

但是当我运行gem版本时,它仍然是1。3.5。做一个宝石在稀土版本的宝石。

Anyone know how to get rubygems to update with RVM?

有人知道如何让rubygems与RVM更新吗?

4 个解决方案

#1


17  

The problem, I think, is the initial command (or what you expect that command to do):

我认为,问题在于最初的命令(或者你期望该命令做什么):

$ rvm ree gem update --system

That tells rvm to pass the gem update --system to the gem under ree, but it doesn't switch you to that particular Ruby interpreter. You continue using whatever interpreter you have set in that shell (whether by default or because you switched manually earlier in the shell session).

这告诉rvm将gem更新——系统传递给ree下的gem,但是不会切换到特定的Ruby解释器。您将继续使用您在该shell中设置的任何解释器(无论是默认设置还是因为您在shell会话之前手动切换)。

As an example, my default interpreter is Ruby 1.9.2. If I pass this command: rvm 1.9.1 gem install pony, then the Pony gem is installed for Ruby 1.9.1. However, I'm still using Ruby 1.9.2 after that installation is finished. If I enter irb and try require 'pony', I get a load error. If I run rvm 1.9.1 and then enter irb, Pony is installed and loads fine.

例如,我的默认解释器是Ruby 1.9.2。如果我通过这个命令:rvm 1.9.1 gem安装pony,那么将pony gem安装到Ruby 1.9.1中。但是,在安装完成之后,我仍然在使用Ruby 1.9.2。如果我输入irb并尝试使用“pony”,我将得到一个加载错误。如果我运行rvm 1.9.1,然后输入irb,那么Pony就会被安装并载入。

So as Brian says in his comment to your post, you could switch manually with rvm use ree. Alternatively, you could switch your initial command to this:

正如Brian在他对你的帖子的评论中所说,你可以用rvm使用ree手动切换。或者,您可以将初始命令转换为:

$ rvm ree
$ gem update --system
$ gem --version

#2


34  

Now you can just do :

现在你可以这样做:

rvm rubygems latest

Or you can define which rubygemsyou really want. https://rvm.io/rubies/rubygems/

或者你可以定义你真正想要的rubygemsx。https://rvm.io/rubies/rubygems/

#3


2  

rvm suggested me to use smth like this:

rvm建议我这样使用smth:

rvm ruby-1.9.3-p327@mygemset do gem update --system

#4


1  

It is an unusual problem. If it is not yet resolved, consider using

这是一个不寻常的问题。如果还没有解决,考虑使用

rvm --default use ree
which ruby
which gem

this should show you if you are in the right version.
install gems either using rvm or directly.

这将显示您是否使用了正确的版本。使用rvm或直接安装gem。

#1


17  

The problem, I think, is the initial command (or what you expect that command to do):

我认为,问题在于最初的命令(或者你期望该命令做什么):

$ rvm ree gem update --system

That tells rvm to pass the gem update --system to the gem under ree, but it doesn't switch you to that particular Ruby interpreter. You continue using whatever interpreter you have set in that shell (whether by default or because you switched manually earlier in the shell session).

这告诉rvm将gem更新——系统传递给ree下的gem,但是不会切换到特定的Ruby解释器。您将继续使用您在该shell中设置的任何解释器(无论是默认设置还是因为您在shell会话之前手动切换)。

As an example, my default interpreter is Ruby 1.9.2. If I pass this command: rvm 1.9.1 gem install pony, then the Pony gem is installed for Ruby 1.9.1. However, I'm still using Ruby 1.9.2 after that installation is finished. If I enter irb and try require 'pony', I get a load error. If I run rvm 1.9.1 and then enter irb, Pony is installed and loads fine.

例如,我的默认解释器是Ruby 1.9.2。如果我通过这个命令:rvm 1.9.1 gem安装pony,那么将pony gem安装到Ruby 1.9.1中。但是,在安装完成之后,我仍然在使用Ruby 1.9.2。如果我输入irb并尝试使用“pony”,我将得到一个加载错误。如果我运行rvm 1.9.1,然后输入irb,那么Pony就会被安装并载入。

So as Brian says in his comment to your post, you could switch manually with rvm use ree. Alternatively, you could switch your initial command to this:

正如Brian在他对你的帖子的评论中所说,你可以用rvm使用ree手动切换。或者,您可以将初始命令转换为:

$ rvm ree
$ gem update --system
$ gem --version

#2


34  

Now you can just do :

现在你可以这样做:

rvm rubygems latest

Or you can define which rubygemsyou really want. https://rvm.io/rubies/rubygems/

或者你可以定义你真正想要的rubygemsx。https://rvm.io/rubies/rubygems/

#3


2  

rvm suggested me to use smth like this:

rvm建议我这样使用smth:

rvm ruby-1.9.3-p327@mygemset do gem update --system

#4


1  

It is an unusual problem. If it is not yet resolved, consider using

这是一个不寻常的问题。如果还没有解决,考虑使用

rvm --default use ree
which ruby
which gem

this should show you if you are in the right version.
install gems either using rvm or directly.

这将显示您是否使用了正确的版本。使用rvm或直接安装gem。