我怎么能用rvm安装rubygems?两者有什么区别?

时间:2021-12-21 20:39:29

I am trying to set up Rails 3.0.3 running on my machine with Ruby 1.9.2. I have installed rvm and used it to install Ruby 1.9.2. What do do next to install the gems I want?

我正在尝试使用Ruby 1.9.2在我的机器上运行Rails 3.0.3。我已经安装了rvm并用它来安装Ruby 1.9.2。下一步安装我想要的宝石怎么办?

In particular, please give the command to install RubyGems 1.3.6 because Rails 3.0.3 is asking for it specifically. Can rvm install Rails by itself, or will I need RubyGems for that?

特别是,请给出安装RubyGems 1.3.6的命令,因为Rails 3.0.3特别要求它。 rvm可以自己安装Rails,还是需要RubyGems呢?

2 个解决方案

#1


9  

Yes, you can install gems with rvm. Use:

是的,您可以使用rvm安装gem。使用:

rvm use 1.9.2 # Make sure you're using the installed version
rvm gem install --version '3.0.3' rails

Updated to include specific version of the gem.

更新以包含特定版本的gem。

#2


4  

Looks like you already have rails installed, from the way you've phrased the question. To install rubygems-1.3.6 using rvm just make sure your rvm install is updated and you're using the ruby you want, and then use rvm rubygems 1.3.6 to select that version of rubygems.

看起来你已经安装了rails,就像你提出问题的方式一样。要使用rvm安装rubygems-1.3.6,请确保您的rvm安装已更新并且您正在使用所需的ruby,然后使用rvm ruby​​gems 1.3.6来选择该版本的rubygems。

rvm get head
rvm reload
rvm use 1.9.2
rvm rubygems 1.3.6

#1


9  

Yes, you can install gems with rvm. Use:

是的,您可以使用rvm安装gem。使用:

rvm use 1.9.2 # Make sure you're using the installed version
rvm gem install --version '3.0.3' rails

Updated to include specific version of the gem.

更新以包含特定版本的gem。

#2


4  

Looks like you already have rails installed, from the way you've phrased the question. To install rubygems-1.3.6 using rvm just make sure your rvm install is updated and you're using the ruby you want, and then use rvm rubygems 1.3.6 to select that version of rubygems.

看起来你已经安装了rails,就像你提出问题的方式一样。要使用rvm安装rubygems-1.3.6,请确保您的rvm安装已更新并且您正在使用所需的ruby,然后使用rvm ruby​​gems 1.3.6来选择该版本的rubygems。

rvm get head
rvm reload
rvm use 1.9.2
rvm rubygems 1.3.6