如何在 RVM gemset 中安装 Rails 4.0?

编程入门 行业动态 更新时间:2024-10-10 14:21:51
本文介绍了如何在 RVM gemset 中安装 Rails 4.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试将 Rails 安装到新的 rvm gemset 中.我尝试了以下方法:

I am trying to install Rails into a new rvm gemset. I tried the following:

rvm gemset create rails-4.0 output: gemset created rails-4.0

接下来我做了:

rvm 2.0.0@rails-4.0

rvm gemset 列表:

rvm gemset list:

gemsets for ruby-2.0.0-p0 (found in /Users/me/.rvm/gems/ruby-2.0.0-p0) (default) global => rails-4.0

导轨 -v

Rails 当前未安装在此系统上.获取最新信息版本,只需输入:

Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails

我列出的 rvm 命令是否不安装 rails 4.0?

Do the rvm commands I listed not install rails 4.0?

推荐答案

这个命令:

rvm gemset create rails-4.0

基本上是在创建一个目录结构来保存 gem.您可以轻松地将其称为rails-4.0"以外的其他名称,例如foo",这将是相同的行为.

is creating basically a directory structure to hold the gems. You could have just as easily called it something other than "rails-4.0" like "foo" and it would be the same behavior.

这个命令:

rvm 2.0.0@rails-4.0

切换到 Ruby 2.0.0 并告诉它使用名为 rails-4.0 的新 gemset.再说一次,这可能是foo"或任何你叫它的东西.

Switches to Ruby 2.0.0 and tells it to use the new gemset named rails-4.0. Again, that could be "foo" or whatever you called it.

现在,要获得 Rails 4.0.x,您需要:

Now, to get Rails 4.0.x, you'd do:

gem install rails --version=4.0

正如 Barrett 之前指出的,要获得 pre/beta/rc 版本,您可以指定整个版本字符串,例如gem install rails --version=4.0.0.rc2.

As Barrett pointed out earlier, to get a pre/beta/rc release, you can specify the whole version string, e.g. gem install rails --version=4.0.0.rc2.

不要 sudo,因为你不应该用 rvm sudo,即使它告诉你.使用系统 ruby​​"(ruby 不是由 rvm 安装),它可能以 root 身份安装,因此您需要超级用户 (su) 访问权限(超级用户 do 或sudo")来执行此操作.但是,rvm 让你以当前用户身份安装东西,因此你不需要 sudo.

Don't sudo, because you shouldn't sudo with rvm, even though it tells you to. With the "system ruby" (ruby not installed by rvm), it may be installed as root, so you need superuser (su) access (superuser do or "sudo") to do that. But, rvm has you install things as the current user, therefore you don't need to sudo.

更多推荐

如何在 RVM gemset 中安装 Rails 4.0?

本文发布于:2023-11-26 05:22:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632798.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   RVM   gemset   Rails

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!