我很困惑:"rails -v"和"gem list"显示了不同的版本 [英] I'm confused: 'rails -v' and 'gem list' show different versions
问题描述
在Windows 7计算机上,我已经完成了Ruby on Rails的全新安装(使用 RailsInstaller )未能遵循Michael Hartl的 Ruby on Rails教程(如果您有兴趣的话,请参阅与我有关的上一个问题失败).
I've made a fresh installation of Ruby on Rails on my Windows 7 machine (using RailsInstaller) after a failed attempt to follow Michael Hartl's Ruby on Rails Tutorial (if you're interested, see my previous question pertaining to the said fail).
由于我认为以前的失败与我尝试安装不同的gem版本以复制教程中提出的要求无能为力有关,所以我决定在安装后立即检查rails gem的版本.
As I thought my previous fail had something to do with my inept attempt at installing different gem versions hoping to replicate requirements laid out in the tutorial, I decided to check the version of rails gem immediately after the install.
当我输入
rails -v
我得到Rails 4.0.2
作为答复,但是当我这样做
I got Rails 4.0.2
as a response, but when I did
gem list
它说rails (3.2.16)
,这让我感到非常困惑.
it said rails (3.2.16)
, and that got me really confused.
我们在这里谈论两件事吗?
Are we talking about two different things here?
请记住这是一个轻松的安装过程:这两个命令是第一个,也是我键入的唯一两个命令.
Mind you that this is a crisp install: these two commands were the first, and the only two commands I ever typed.
这是否是我无法的原因为我的示例项目启动WEBrick ?
谢谢!
推荐答案
您看到的原因是仍安装了Railties
可执行包装.您需要卸载Rails
gem 和和Railties
gem.
The reason you are seeing this is the Railties
executable wrapper is still installed. You need to uninstall the Rails
gem and and the Railties
gem.
$ gem uninstall rails
$ gem uninstall railties
系统可能会提示您选择要卸载的gem版本.
You will likely be prompted to select which version of the gem to uninstall.
如果需要,您可以重新安装特定版本的Rails.
If needed, you can reinstall a specific version of Rails.
$ gem install rails -v 3.2.16
$ gem install railties -v 3.2.16
这篇关于我很困惑:"rails -v"和"gem list"显示了不同的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!