简体   繁体   English

Rails 2.3.8问题

[英]Rails 2.3.8 problem

I am running Ruby 1.9.1 & rails 2.3.8. 我正在运行Ruby 1.9.1和Rails 2.3.8。 Everything is installed fine as far as I can tell but when I run rake db:migrate I get this error: 据我所知,一切都安装正确,但是当我运行rake db:migrate时,出现此错误:

Missing the Rails 2.3.8 gem. 缺少Rails 2.3.8宝石。 Please gem install -v=2.3.8 rails , update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. gem install -v=2.3.8 rails ,在config / environment.rb中为您已安装的Rails版本更新RAILS_GEM_VERSION设置,或注释掉RAILS_GEM_VERSION以使用已安装的最新版本。

So I wanted to make sure I had rails installed and ran from the command line rails -v & it says Rails 2.3.8. 因此,我想确保安装了rails并从命令行rails -v上运行它并说Rails 2.3.8。 So I am not sure what gives here. 因此,我不确定这里提供了什么。 Can anyone point me in the right direction? 谁能指出我正确的方向? thank you very much. 非常感谢你。

Well, if you really have those versions installed and you get the error, something may be wrong. 好吧,如果您确实安装了那些版本,并且出现了错误,则可能是有些问题。

But, you can do as the message recommends and comment out the setting in your config/environment.rb so it tries to use whatever version you have installed. 但是,您可以按照消息的建议进行操作,并注释掉config / environment.rb中的设置,以便它尝试使用已安装的任何版本。

Did you install rails with a different package manager? 您是否使用其他软件包管理器安装了rails? If I install rails with "sudo apt-get install rails" then "rails -v" uses the rails binary in /bin (even if it's 2.3.5 or 2.0.2) because that is first in my path. 如果我使用“ sudo apt-get install rails”安装rails,则“ rails -v”会在/ bin中使用rails二进制文件(即使是2.3.5或2.0.2),因为这是我的第一个路径。 If after that I install rails with "sudo gem install rails -v=2.3.8" typing "rails -v" still gives me the version of the /bin rails. 如果在那之后我使用“ sudo gem install rails -v = 2.3.8”安装rails,则键入“ rails -v”仍会提供/ bin rails的版本。 I haven't verified, but I would guess this is the same issue if you're using macports. 我尚未验证,但是如果您使用的是Macports,我想这是同样的问题。 If you uninstall the package you installed with the non rubygems package manger and then reinstall rails with rubygems that may fix your issue. 如果您卸载使用非rubygems软件包管理器安装的软件包,然后使用rubygems重新安装rails,这可能会解决您的问题。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM