0

在安装 Ruby 和 RoR 方面需要一些帮助

我最初在上周末(2012 年 9 月 15 日)安装了所有东西,包括 Ruby、RoR 和 RubyMine。我刚刚在我的 win 7 64 位机器上打开了一个命令提示符并运行:

$ rails --version

令我惊讶的是,它返回了 2.3.14,因为我期望看到 3.2.8

然后我跑了:

$ gem install rails

哪个输出:

Successfully installed rails-3.2.8
1 gem installed
Installing ri documentation for rails-3.2.8...
Installing RDoc documentation for rails-3.2.8...

然后rails --version再次运行仍然输出 2.3.14

我有点困惑为什么新安装(按照这里的说明 http://rubyonrails.org/download)似乎安装了一个非常旧的版本。

如何安装最新版本?

谢谢,

4

2 回答 2

2

听起来你已经安装了两个版本。运行“gem uninstall rails”,它将列出版本并询问您要删除哪个版本。然后选择旧的删除。

于 2012-09-22T21:26:23.847 回答
0

我现在已经走得更远了。我跑了:

F:\>gem cleanup rails
Cleaning up installed gems... Attempting to uninstall rails-2.3.14

You have requested to uninstall the gem:
    rails-2.3.14
restful_authentication-1.1.6 depends on [rails (~> 2.3.4)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  y
Executables and scripts will remain installed.
Successfully uninstalled rails-2.3.14
Clean Up Complete

F:\>gem uninstall restful_authentication
Successfully uninstalled restful_authentication-1.1.6

F:\>gem install rails
Successfully installed rails-3.2.8
1 gem installed
Installing ri documentation for rails-3.2.8...
Installing RDoc documentation for rails-3.2.8...

F:\>rails -v
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:317:in `bin_path': can't find ge
m rails ([">= 0"]) with executable rails (Gem::GemNotFoundException)
        from C:/Ruby193/bin/rails:23:in `<main>'

所以现在它告诉我它已成功安装 rails 但现在当我查询它的版本时出错。

于 2012-09-22T22:19:27.587 回答