简体   繁体   English

更新rubygems后Ruby on Rails错误:“找不到gems []> = 0”

[英]Ruby on Rails error after updating rubygems: “ Failed to find gems [] >= 0”

I just installed Ruby on Rails, and while trying to follow this tutorial I kept running into a warning telling me to update rubygems and then run gem pristine --all . 我刚刚安装了Ruby on Rails,在尝试按照本教程的时候,我不断遇到警告告诉我更新rubygems然后运行gem pristine --all I updated using sudo gem install rubygems-update and tried running gem pristine --all , which resulted in the following error: 我使用sudo gem install rubygems-update并尝试运行gem pristine --all ,这导致以下错误:

ERROR:  While executing gem ... (Gem::Exception)
    Failed to find gems [] >= 0

I also tried running bin/rails server on a blog application and I got the following error: 我也尝试在博客应用程序上运行bin/rails server ,我收到以下错误:

/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
    from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/mariana/Documents/RD-anagram/rails-test/blog/bin/spring:8:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

I also cannot run rails --version , because I get this error: 我也无法运行rails --version ,因为我收到此错误:

/usr/local/lib/site_ruby/1.9.1/rubygems/dependency.rb:319:in `to_specs': Could not find 'railties' (>= 0) among 0 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/mariana/.gem/ruby/1.9.1:/usr/lib/ruby/gems/1.9.1', execute `gem env` for more information
    from /usr/local/lib/site_ruby/1.9.1/rubygems/dependency.rb:328:in `to_spec'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:65:in `gem'
    from /usr/local/bin/rails:22:in `<main>'

Does anyone know how to solve this? 有谁知道如何解决这个问题? Did I do something wrong? 我做错什么了吗?

Looks like you have the bundler gem missing. 看起来你没有捆绑宝石。

Do:- 做:-

gem install rails    
[sudo] gem install bundler
bundle install
gem install railties

If the above code doesnt work, you can do a rvm implode to reinstall rvm. 如果上面的代码不起作用,你可以做一个rvm implode来重新安装rvm。 Note that the command recursively delete all rvm environments. 请注意,该命令以递归方式删除所有rvm环境。

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

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