如何解决rails的错误gem::missingspecversionerror问题?

fv2wmkja  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(336)

我在尝试运行应用程序时遇到以下错误,因此不确定如何解决它。

$ rails s
Traceback (most recent call last):
    5: from bin/rails:2:in `<main>'
    4: from bin/rails:2:in `load'
    3: from /Users/jolienai/Documents/github.com/railsfriends/friends/bin/spring:3:in `<top (required)>'
    2: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_gem.rb:62:in `gem'
    1: from /Library/Ruby/Site/2.6.0/rubygems/dependency.rb:323:in `to_spec'
/Library/Ruby/Site/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.2.24) required by your /Users/jolienai/Documents/github.com/railsfriends/friends/Gemfile.lock. (Gem::MissingSpecVersionError)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.2.24`
Checked in 'GEM_PATH=/Users/jolienai/.gem/ruby/2.6.0:/Library/Ruby/Gems/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0' , execute `gem env` for more information
~/Documents/github.com/railsfriends/friends $

我尝试了下面的命令,但又出现了一个错误

$ gem install bundler:2.2.24
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted @ apply2files - /usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.2.24/CHANGELOG.md
$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.24
  - RUBY VERSION: 3.0.2 (2021-07-07 patchlevel 107) [x86_64-darwin20]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/3.0.0
  - USER INSTALLATION DIRECTORY: /Users/jolienai/.gem/ruby/3.0.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/3.0.0/bin
  - SPEC CACHE DIRECTORY: /Users/jolienai/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/3.0.2/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-darwin-20
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/3.0.0
     - /Users/jolienai/.gem/ruby/3.0.0
     - /usr/local/Cellar/ruby/3.0.2/lib/ruby/gems/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/opt/ruby/bin
     - /Users/jolienai/google-cloud-sdk/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/go/bin
     - /usr/local/share/dotnet
     - ~/.dotnet/tools
     - /Library/Frameworks/Mono.framework/Versions/Current/Commands
     - /Users/jolienai/.rvm/bin

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题