简体   繁体   English

Ruby on rails: - 找不到RubyGem rails(> = 0)(Gem :: LoadError)

[英]Ruby on rails :- Could not find RubyGem rails (>= 0) (Gem::LoadError)

I am very new to Ruby on Rails. 我是Ruby on Rails的新手。 I installed ruby on rails on my Windows 7 using the installer in http://railsinstaller.org/ . 我使用http://railsinstaller.org/中的安装程序在Windows 7上的rails上安装了ruby。 I could create a project once and thereafter I was not (I dont know what did I do in between :-( ). 我可以创建一个项目,然后我不是(我不知道我做了什么:-()。

The complete errors messages are :- 完整的错误消息是: -

On creating a new project :- 在创建新项目时 : -

c:\Sites>rails new Tickets_Test
E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Cou
ld not find RubyGem rails (>= 0) (Gem::LoadError)
        from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
        from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
        from E:/Ashish/RailsInstaller/Ruby1.8.7/bin/rails:18:in `<main>'

on just getting the version :- 刚刚获得版本 : -

c:\Sites>rails --version
E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Cou
ld not find RubyGem rails (>= 0) (Gem::LoadError)
        from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
        from E:/Ashish/Ruby192/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
        from E:/Ashish/RailsInstaller/Ruby1.8.7/bin/rails:18:in `<main>'

Any idea why the above is happening? 知道为什么会发生这种情况吗?

EDIT 编辑

Appearently there are two command prompts :- Ruby command prompt :- 显然有两个命令提示: - Ruby命令提示符: - 红宝石 and Ruby for rails command prompt (The problem is resolved using this command prompt):- 和Ruby for rails命令提示符(使用此命令提示符解决问题): - Ruby on rails

I was using ruby command prompt. 我正在使用ruby命令提示符。 Sounds like a stupid question, however, I am not sure how there are "two" command prompts? 听起来像是一个愚蠢的问题,但是,我不确定是否有“两个”命令提示?

I ran into a similar issues after installing heroku toolbelt. 安装heroku工具带后,我遇到了类似的问题。 I found that heroku added the second one to my path. 我发现heroku将第二个添加到我的路径中。 I removed it from the path and life seems good again! 我把它从路径中删除了,生活再次好看!

You seem to have two Ruby versions in your system, 1.9.1 and 1.8.7. 您的系统中似乎有两个Ruby版本,1.9.1和1.8.7。 Rails gem seems to be installed only for one of them. Rails gem似乎只为其中一个安装。 I'd suggest you to remove one of these versions, and reinstall Rails. 我建议你删除其中一个版本,然后重新安装Rails。

If you have two Ruby versions in your system, 1.9.1 and 1.8.7, then no need to remove any. 如果您的系统中有两个Ruby版本,1.9.1和1.8.7,则无需删除任何版本。 You can switch between these two Ruby versions with the help of RVM on OS X and Linux. 您可以在OS X和Linux上借助RVM在这两个Ruby版本之间切换。 And for Windows you can use Pik. 对于Windows,您可以使用Pik。

For further details, you can go through posts - http://rorguide.blogspot.com/2011/03/pik-rvm-tools-to-manage-multiple-ruby.html 有关详细信息,您可以浏览帖子 - http://rorguide.blogspot.com/2011/03/pik-rvm-tools-to-manage-multiple-ruby.html

Try using Pik (available at http://github.com ) to switch between the two or edit your path to include one but not the other. 尝试使用Pik(可从http://github.com获得 )在两者之间切换或编辑您的路径以包含一个但不包括另一个。 That's simpler. 那更简单。

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

相关问题 找不到RubyGem rails(&gt; = 0)(Gem :: LoadError) - Could not find RubyGem rails (>= 0) (Gem::LoadError) Rails服务器错误:“找不到RubyGem rails(&gt; = 0)(Gem :: LoadError)” - Rails Server Error: “Could not find RubyGem rails (>=0) (Gem:: LoadError)” rails 2.3.2项目:找不到RubyGem uuid(&gt; = 0)(Gem :: LoadError) - rails 2.3.2 project: Could not find RubyGem uuid (>= 0) (Gem::LoadError) 使用RailsInstaller找不到RubyGem栏杆(&gt; = 0)(Gem :: LoadError) - Could not find RubyGem railties (>= 0) (Gem::LoadError) with the RailsInstaller 在 [] (Gem::LoadError) 中找不到导轨 (&gt;= 0) - Could not find rails (>= 0) amongst [] (Gem::LoadError) Ruby on Rails,找不到有效的宝石&#39;rails&#39; - Ruby on Rails, could not find a valid gem 'rails' 找不到RubyGem rails-Rails Server错误 - Could not find RubyGem rails - Rails Server error 使用rails 2.3.18在[](Gem :: LoadError)中找不到bundler(> = 0) - Could not find bundler (>= 0) amongst [] (Gem::LoadError) with rails 2.3.18 /Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': 找不到 RubyGem heroku (&gt;= 0) (Gem::LoadError) - /Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem heroku (>= 0) (Gem::LoadError) Rails 2.3.8:找不到RubyGem捆绑程序 - Rails 2.3.8: Could not find RubyGem bundler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM