我正在尝试将 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.0rvm 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?
发布评论