Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
674 views
in Technique[技术] by (71.8m points)

rubygems - Bundler 2.0.1 installed, Rails says "must use Bundler 2 or greater"?

I'm a Rails newb who's trying out Rails on a DigitalOcean droplet. The installations seemed to work fine, but I'm getting a curious error message when I try to generate a scaffold:

DO 10:48 Rails/simple (master) → rails generate scaffold User name:string email:string
Traceback (most recent call last):
        5: from bin/rails:3:in `<main>'
        4: from bin/rails:3:in `load'
        3: from /home/tony/rails/simple/bin/spring:10:in `<top (required)>'
        2: from /home/tony/rails/simple/bin/spring:10:in `new'
        1: from /home/tony/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
/home/tony/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
DO 10:49 Rails/simple (master) → bundle list bundler
/home/tony/.rvm/gems/ruby-2.6.0/gems/bundler-2.0.1
DO 10:50 Rails/simple (master) → gem list bundler

*** LOCAL GEMS ***

bundler (2.0.1, default: 1.17.2)
bundler-unload (1.0.2)
rubygems-bundler (1.4.5)

I.e., the current Bundler gem is version 2.0.1, but Rails still thinks it's insufficient.

I can't find anything similar on the web. The only red flag I can see is that the bundler gem shows a default version of 1.17.2. How do I begin to diagnose the problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This helped me: gem update --system


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...