为什么我所有的Gem命令突然都不起作用?

时间:2018-11-22 17:40:46

标签: ruby-on-rails ruby command-line rubygems

每次我想编写任何gem命令时,我都会收到以下消息:

Traceback (most recent call last):
8: from C:/Ruby25-x64/bin/gem:9:in `<main>'
7: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
6: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
5: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/gem_runner.rb:86:in `<top (required)>'
4: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems.rb:1140:in `load_plugins'
3: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems.rb:556:in `find_latest_files'
2: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1156:in `latest_specs'
1: from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1173:in `_latest_specs'
C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1173:in `sort_by': comparison of Array with String failed (ArgumentError)

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。我实际上是在学习Rails上的ruby,并且要配合我使用MySQL启动新的Rails应用程序并在项目根目录中启动Rails服务器的过程,但是由于找不到宝石,它没有用。我在网上找到的解决方案之一是编辑MySQL .gemspec文件,但事情变得更糟,突然没有任何gem命令运行了。我先卸载了ruby,然后再次安装,再重新安装了gems(包括rails),解决了这个问题