2012-09-22 228 views
0

需要一點幫助,安裝Ruby和RoR的紅寶石版本混亂

我最初安裝的一切在上週末(15/09/2012)包括 紅寶石,回報率和RubyMine的。我剛剛打開我贏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的說明)似乎已經安裝了一個很老的版本 。

如何獲取最新版本?

謝謝,

+0

你有沒有關閉並打開cmd? – AJcodez

+0

是的,試過了,謝謝。 – Jammer

+0

你出現在窗戶上。你使用RailsInstaller嗎? –

回答

2

聽起來像你有兩個版本安裝。運行「gem uninstall rails」,它會列出這些版本並詢問你想刪除哪一個。然後選擇舊的刪除。

+2

好,但更好的是'寶石清理軌道'。 – Hauleth

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>' 

所以現在它告訴我,它已成功安裝導軌,但現在錯誤,當我查詢它的版本。