微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Bundler 在任何资源中都找不到 rake

如何解决Bundler 在任何资源中都找不到 rake

我正在使用 docker 运行 ruby​​ 版本 2.6.1。 Rake gem 版本为 13.0.1。
每当我尝试 docker-compose up 时,它总是失败并每次都抛出此错误
这个错误以前不存在。

redis_1  | WARNING: no logs are available with the 'none' log driver
db_1     | WARNING: no logs are available with the 'none' log driver
web_1    | bundler: Failed to load command: rails (/bundle/bin/rails)
web_1    | Bundler::GemNotFound: Could not find rake-13.0.1 in any of the sources
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/spec_set.rb:85:in `map!'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/spec_set.rb:85:in `materialize'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/deFinition.rb:170:in `specs'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/deFinition.rb:237:in `specs_for'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/deFinition.rb:226:in `requested_specs'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:108:in `block in deFinition_method'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:20:in `setup'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler.rb:107:in `setup'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/bundler/setup.rb:20:in `<top (required)>'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
web_1    |   /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

这是我的 Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '~> 2.6.1'

gem 'rails','~> 5.2.2'
gem 'MysqL2'
gem 'puma','~> 3.11'
gem 'sass-rails','~> 5.0'
gem 'uglifier','>= 1.3.0'
gem 'webpacker'

gem 'coffee-rails','~> 4.2'
gem 'turbolinks','~> 5'
gem 'jbuilder','~> 2.5'
# gem 'redis','~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt','~> 3.1.7'
gem 'rake'

# Use ActiveStorage variant
# gem 'mini_magick','~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails',group: :development

gem 'active_hash'
gem 'active_hash-like'

gem 'devise'
gem 'devise-i18n'
gem 'devise_invitable' # deviseに招待機能を追加

gem 'simple_form'
gem 'kaminari'
gem 'paperclip'
gem 'ransack'      
gem 'active_link_to'
gem 'gretel'      
gem 'whenever'     
gem 'Meta-tags'    
gem 'kakurenbo-puti'
gem 'jpmobile'
# gem 'geokit' # 測地系
gem 'slim-rails'
gem 'sitemap_generator'
# gem 'font-awesome-rails'#railsでfont-awesome仕様
gem 'exception_notification'
gem 'slack-notifier'
gem 'easy_settings'
gem 'enum_help'
gem 'i18n_generators' 
gem 'inline_svg'
# gem 'select2-rails'
gem 'draper' 
# gem 'cancancan'#権限管理(パックラインユーザーなど)
# gem 'cocoon' # nested form
# gem 'wicked_pdf'#キャプチャ用gem3
# gem 'wkhtmltopdf-binary'#キャプチャ用gem2

# AWS S3など用
# gem 'aws-sdk','~> 3'
gem 'aws-sdk-s3','~> 1'
gem 'aws-ses','~> 0.6'
# 並列処理用
gem 'parallel'
gem 'ruby-progressbar'
# gem 'rambulance' # このGemのBugが多いので、廃止

gem 'premailer-rails' 

gem 'maxminddb' 

gem 'counter_culture','~> 2.0'
gem 'recaptcha'
gem 'mimemagic',github: 'mimemagicrb/mimemagic',ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f' 

group :development do
  gem 'letter_opener' # dev mail
  gem 'letter_opener_web' # http://localhost:8001/letter_opener
  gem 'rubocop',require: false
  gem 'rubocop-airbnb'
end

group :development do
  gem 'foreman' 
end

group :development,:test,:staging do
  gem 'pry-rails'  
  gem 'pry-doc'    
  gem 'pry-byebug' 
  gem 'pry-stack_explorer' 
end

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap','>= 1.1.0',require: false

group :development,:test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug',platforms: [:mri,:mingw,:x64_mingw]
  gem 'dotenv-rails'
end

# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console','>= 3.3.0',group: :development

group :development,:staging do
  gem 'listen','>= 3.0.5','< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen','~> 2.0.0'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara','>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of chromedriver to run system tests with Chrome
  gem 'webdrivers'
end

# TEST Tools
group :development,:test do
  gem 'rspec'                  
  gem 'rspec-rails'            
  gem 'factory_bot_rails'     
  gem 'faker'                  
  gem 'database_cleaner'       
  gem 'timecop'                
  gem 'spring-commands-rspec'  
  gem 'launchy'
end


gem 'tzinfo-data',platforms: [:mingw,:mswin,:x64_mingw,:jruby]

这是我的锁文件

GIT
  remote: https://github.com/mimemagicrb/mimemagic.git
  revision: 01f92d86d15d85cfd0f20dabd025dcbd36a8a60f
  ref: 01f92d86d15d85cfd0f20dabd025dcbd36a8a60f
  specs:
    mimemagic (0.3.5)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.2.4.3)
      actionpack (= 5.2.4.3)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailer (5.2.4.3)
      actionpack (= 5.2.4.3)
      actionview (= 5.2.4.3)
      activejob (= 5.2.4.3)
      mail (~> 2.5,>= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.2.4.3)
      actionview (= 5.2.4.3)
      activesupport (= 5.2.4.3)
      rack (~> 2.0,>= 2.0.8)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0,>= 1.0.2)
    actionview (5.2.4.3)
      activesupport (= 5.2.4.3)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0,>= 1.0.3)
    active_hash (3.1.0)
      activesupport (>= 5.0.0)
    active_hash-like (0.1.0)
      active_hash
    active_link_to (1.0.5)
      actionpack
      addressable
    activejob (5.2.4.3)
      activesupport (= 5.2.4.3)
      globalid (>= 0.3.6)
    activemodel (5.2.4.3)
      activesupport (= 5.2.4.3)
    activemodel-serializers-xml (1.0.2)
      activemodel (> 5.x)
      activesupport (> 5.x)
      builder (~> 3.1)
    activerecord (5.2.4.3)
      activemodel (= 5.2.4.3)
      activesupport (= 5.2.4.3)
      arel (>= 9.0)
    activestorage (5.2.4.3)
      actionpack (= 5.2.4.3)
      activerecord (= 5.2.4.3)
      marcel (~> 0.3.1)
    activesupport (5.2.4.3)
      concurrent-ruby (~> 1.0,>= 1.0.2)
      i18n (>= 0.7,< 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.7.0)
      public_suffix (>= 2.0.2,< 5.0)
    after_commit_action (1.1.0)
      activerecord (>= 3.0.0)
      activesupport (>= 3.0.0)
    arel (9.0.0)
    ast (2.4.1)
    aws-eventstream (1.1.0)
    aws-partitions (1.360.0)
    aws-sdk-core (3.105.0)
      aws-eventstream (~> 1,>= 1.0.2)
      aws-partitions (~> 1,>= 1.239.0)
      aws-sigv4 (~> 1.1)
      jmespath (~> 1.0)
    aws-sdk-kms (1.37.0)
      aws-sdk-core (~> 3,>= 3.99.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-s3 (1.79.1)
      aws-sdk-core (~> 3,>= 3.104.3)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.1)
    aws-ses (0.6.0)
      builder
      mail (> 2.2.5)
      mime-types
      xml-simple
    aws-sigv4 (1.2.2)
      aws-eventstream (~> 1,>= 1.0.2)
    bcrypt (3.1.15)
    bindex (0.8.1)
    binding_of_caller (0.8.0)
      debug_inspector (>= 0.0.1)
    bootsnap (1.4.8)
      msgpack (~> 1.0)
    builder (3.2.4)
    byebug (11.1.3)
    capybara (3.33.0)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (~> 1.5)
      xpath (~> 3.2)
    childprocess (3.0.0)
    chronic (0.10.2)
    climate_control (0.2.0)
    coderay (1.1.3)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.1.7)
    counter_culture (2.6.0)
      activerecord (>= 4.2)
      activesupport (>= 4.2)
      after_commit_action (~> 1.0)
    crass (1.0.6)
    css_parser (1.7.1)
      addressable
    database_cleaner (1.8.5)
    debug_inspector (0.0.3)
    devise (4.7.2)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0)
      responders
      warden (~> 1.2.3)
    devise-i18n (1.9.2)
      devise (>= 4.7.1)
    devise_invitable (2.0.2)
      actionmailer (>= 5.0)
      devise (>= 4.6)
    diff-lcs (1.4.4)
    dotenv (2.7.6)
    dotenv-rails (2.7.6)
      dotenv (= 2.7.6)
      railties (>= 3.2)
    draper (4.0.1)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
      activemodel-serializers-xml (>= 1.0)
      activesupport (>= 5.0)
      request_store (>= 1.0)
    easy_settings (0.1.2)
      hashie (~> 3.4.3)
    enum_help (0.0.17)
      activesupport (>= 3.0.0)
    erubi (1.9.0)
    exception_notification (4.4.3)
      actionmailer (>= 4.0,< 7)
      activesupport (>= 4.0,< 7)
    execjs (2.7.0)
    factory_bot (6.1.0)
      activesupport (>= 5.0.0)
    factory_bot_rails (6.1.0)
      factory_bot (~> 6.1.0)
      railties (>= 5.0.0)
    faker (2.13.0)
      i18n (>= 1.6,< 2)
    ffi (1.13.1)
    ffi (1.13.1-x86-mingw32)
    foreman (0.87.2)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    gretel (4.0.2)
      rails (>= 5.1)
    hashie (3.4.6)
    htmlentities (4.3.4)
    i18n (1.8.5)
      concurrent-ruby (~> 1.0)
    i18n_generators (2.2.2)
      activerecord (>= 3.0.0)
      railties (>= 3.0.0)
    inline_svg (1.7.1)
      activesupport (>= 3.0)
      nokogiri (>= 1.6)
    jaro_winkler (1.5.4)
    jbuilder (2.10.0)
      activesupport (>= 5.0.0)
    jmespath (1.4.0)
    jpmobile (6.0.0)
      mail (~> 2.7.0)
    json (2.3.1)
    kakurenbo-puti (0.5.0)
      activerecord (>= 4.1.0)
    kaminari (1.2.1)
      activesupport (>= 4.1.0)
      kaminari-actionview (= 1.2.1)
      kaminari-activerecord (= 1.2.1)
      kaminari-core (= 1.2.1)
    kaminari-actionview (1.2.1)
      actionview
      kaminari-core (= 1.2.1)
    kaminari-activerecord (1.2.1)
      activerecord
      kaminari-core (= 1.2.1)
    kaminari-core (1.2.1)
    launchy (2.5.0)
      addressable (~> 2.7)
    letter_opener (1.7.0)
      launchy (~> 2.2)
    letter_opener_web (1.4.0)
      actionmailer (>= 3.2)
      letter_opener (~> 1.0)
      railties (>= 3.2)
    listen (3.1.5)
      rb-fsevent (~> 0.9,>= 0.9.4)
      rb-inotify (~> 0.9,>= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.7.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    maxminddb (0.1.22)
    Meta-tags (2.13.0)
      actionpack (>= 3.2.0,< 6.1)
    method_source (1.0.0)
    mime-types (3.3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2020.0512)
    mini_mime (1.0.2)
    mini_portile2 (2.4.0)
    minitest (5.14.1)
    msgpack (1.3.3)
    msgpack (1.3.3-x86-mingw32)
    MysqL2 (0.5.3)
    MysqL2 (0.5.3-x86-mingw32)
    nio4r (2.5.2)
    nokogiri (1.10.10)
      mini_portile2 (~> 2.4.0)
    nokogiri (1.10.10-x86-mingw32)
      mini_portile2 (~> 2.4.0)
    orm_adapter (0.5.0)
    paperclip (6.1.0)
      activemodel (>= 4.2.0)
      activesupport (>= 4.2.0)
      mime-types
      mimemagic (~> 0.3.0)
      terrapin (~> 0.6.0)
    parallel (1.19.2)
    parser (2.7.1.4)
      ast (~> 2.4.1)
    polyamorous (2.3.2)
      activerecord (>= 5.2.1)
    premailer (1.13.1)
      addressable
      css_parser (>= 1.6.0)
      htmlentities (>= 4.0.0)
    premailer-rails (1.11.1)
      actionmailer (>= 3)
      premailer (~> 1.7,>= 1.7.9)
    pry (0.13.1)
      coderay (~> 1.1)
      method_source (~> 1.0)
    pry-byebug (3.9.0)
      byebug (~> 11.0)
      pry (~> 0.13.0)
    pry-doc (1.1.0)
      pry (~> 0.11)
      yard (~> 0.9.11)
    pry-rails (0.3.9)
      pry (>= 0.10.4)
    pry-stack_explorer (0.5.1)
      binding_of_caller (~> 0.7)
      pry (~> 0.13)
    public_suffix (4.0.5)
    puma (3.12.6)
    rack (2.2.3)
    rack-proxy (0.6.5)
      rack
    rack-test (1.1.0)
      rack (>= 1.0,< 3)
    rails (5.2.4.3)
      actioncable (= 5.2.4.3)
      actionmailer (= 5.2.4.3)
      actionpack (= 5.2.4.3)
      actionview (= 5.2.4.3)
      activejob (= 5.2.4.3)
      activemodel (= 5.2.4.3)
      activerecord (= 5.2.4.3)
      activestorage (= 5.2.4.3)
      activesupport (= 5.2.4.3)
      bundler (>= 1.3.0)
      railties (= 5.2.4.3)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    railties (5.2.4.3)
      actionpack (= 5.2.4.3)
      activesupport (= 5.2.4.3)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.19.0,< 2.0)
    rainbow (3.0.0)
    rake (13.0.1)
    ransack (2.3.2)
      activerecord (>= 5.2.1)
      activesupport (>= 5.2.1)
      i18n
      polyamorous (= 2.3.2)
    rb-fsevent (0.10.4)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    recaptcha (5.5.0)
      json
    regexp_parser (1.7.1)
    request_store (1.5.0)
      rack (>= 1.4)
    responders (3.0.1)
      actionpack (>= 5.0)
      railties (>= 5.0)
    rspec (3.9.0)
      rspec-core (~> 3.9.0)
      rspec-expectations (~> 3.9.0)
      rspec-mocks (~> 3.9.0)
    rspec-core (3.9.2)
      rspec-support (~> 3.9.3)
    rspec-expectations (3.9.2)
      diff-lcs (>= 1.2.0,< 2.0)
      rspec-support (~> 3.9.0)
    rspec-mocks (3.9.1)
      diff-lcs (>= 1.2.0,< 2.0)
      rspec-support (~> 3.9.0)
    rspec-rails (4.0.1)
      actionpack (>= 4.2)
      activesupport (>= 4.2)
      railties (>= 4.2)
      rspec-core (~> 3.9)
      rspec-expectations (~> 3.9)
      rspec-mocks (~> 3.9)
      rspec-support (~> 3.9)
    rspec-support (3.9.3)
    rubocop (0.76.0)
      jaro_winkler (~> 1.5.1)
      parallel (~> 1.10)
      parser (>= 2.6)
      rainbow (>= 2.2.2,< 4.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 1.4.0,< 1.7)
    rubocop-airbnb (3.0.2)
      rubocop (~> 0.76.0)
      rubocop-performance (~> 1.5.0)
      rubocop-rails (~> 2.3.2)
      rubocop-rspec (~> 1.30.0)
    rubocop-performance (1.5.2)
      rubocop (>= 0.71.0)
    rubocop-rails (2.3.2)
      rack (>= 1.1)
      rubocop (>= 0.72.0)
    rubocop-rspec (1.30.1)
      rubocop (>= 0.60.0)
    ruby-progressbar (1.10.1)
    ruby_dep (1.5.0)
    rubyzip (2.3.0)
    sass (3.7.4)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9,>= 0.9.7)
    sass-rails (5.1.0)
      railties (>= 5.2.0)
      sass (~> 3.1)
      sprockets (>= 2.8,< 4.0)
      sprockets-rails (>= 2.0,< 4.0)
      tilt (>= 1.1,< 3)
    selenium-webdriver (3.142.7)
      childprocess (>= 0.5,< 4.0)
      rubyzip (>= 1.2.2)
    semantic_range (2.3.0)
    simple_form (5.0.2)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
    sitemap_generator (6.1.2)
      builder (~> 3.0)
    slack-notifier (2.3.2)
    slim (4.1.0)
      temple (>= 0.7.6,< 0.9)
      tilt (>= 2.0.6,< 2.1)
    slim-rails (3.2.0)
      actionpack (>= 3.1)
      railties (>= 3.1)
      slim (>= 3.0,< 5.0)
    spring (2.1.1)
    spring-commands-rspec (1.0.4)
      spring (>= 0.9.1)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7,< 4.0)
      spring (>= 1.2,< 3.0)
    sprockets (3.7.2)
      concurrent-ruby (~> 1.0)
      rack (> 1,< 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    temple (0.8.2)
    terrapin (0.6.0)
      climate_control (>= 0.0.3,< 1.0)
    thor (1.0.1)
    thread_safe (0.3.6)
    tilt (2.0.10)
    timecop (0.9.1)
    turbolinks (5.2.1)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (1.2.7)
      thread_safe (~> 0.1)
    tzinfo-data (1.2021.1)
      tzinfo (>= 1.0.0)
    uglifier (4.2.0)
      execjs (>= 0.3.0,< 3)
    unicode-display_width (1.6.1)
    warden (1.2.8)
      rack (>= 2.0.6)
    web-console (3.7.0)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    webdrivers (4.4.1)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (>= 3.0,< 4.0)
    webpacker (5.2.1)
      activesupport (>= 5.2)
      rack-proxy (>= 0.6.1)
      railties (>= 5.2)
      semantic_range (>= 2.3.0)
    websocket-driver (0.7.3)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    whenever (1.0.0)
      chronic (>= 0.6.3)
    xml-simple (1.1.5)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    yard (0.9.25)

PLATFORMS
  ruby
  x86-mingw32

DEPENDENCIES
  active_hash
  active_hash-like
  active_link_to
  aws-sdk-s3 (~> 1)
  aws-ses (~> 0.6)
  bootsnap (>= 1.1.0)
  byebug
  capybara (>= 2.15)
  coffee-rails (~> 4.2)
  counter_culture (~> 2.0)
  database_cleaner
  devise
  devise-i18n
  devise_invitable
  dotenv-rails
  draper
  easy_settings
  enum_help
  exception_notification
  factory_bot_rails
  faker
  foreman
  gretel
  i18n_generators
  inline_svg
  jbuilder (~> 2.5)
  jpmobile
  kakurenbo-puti
  kaminari
  launchy
  letter_opener
  letter_opener_web
  listen (>= 3.0.5,< 3.2)
  maxminddb
  Meta-tags
  mimemagic!
  MysqL2
  paperclip
  parallel
  premailer-rails
  pry-byebug
  pry-doc
  pry-rails
  pry-stack_explorer
  puma (~> 3.11)
  rails (~> 5.2.2)
  rake
  ransack
  recaptcha
  rspec
  rspec-rails
  rubocop
  rubocop-airbnb
  ruby-progressbar
  sass-rails (~> 5.0)
  selenium-webdriver
  simple_form
  sitemap_generator
  slack-notifier
  slim-rails
  spring
  spring-commands-rspec
  spring-watcher-listen (~> 2.0.0)
  timecop
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console (>= 3.3.0)
  webdrivers
  webpacker
  whenever

RUBY VERSION
   ruby 2.6.1p33

BUNDLED WITH
   1.17.3

我尝试删除我的锁定文件,然后运行 ​​bundle install 和 docker-compose up,但仍然无法正常工作。我已经尝试了我在网上找到的几乎所有解决方案,它们如下:

  1. 捆绑 --full-index
  2. gem 安装包
  3. 捆绑安装 --path vendor/cache
  4. 捆绑安装 --system
  5. gem install rake && bundle install
  6. gem update --system && bundle install
  7. 捆绑安装 --path vendor/bundle
  8. 捆绑更新耙
  9. gem install rack 命令并运行 bundle update rake
  10. gem uninstall rake 然后 gem install rake -v 13.0.1
  11. 我什至尝试删除我的 docker 容器,然后创建一个新容器。

但它们都不适合我,这有点令人沮丧。
如果有人最终能为此找到解决方案,那就太好了。

提前致谢。

更新: 这是我的 docker-compose.yml

version: "3.7"
services:
  db:
    image: "MysqL:5.7"
    restart: always
    environment:
     MysqL_ROOT_PASSWORD: root
     MysqL_USERNAME: root
     MysqL_PASSWORD: root
        - '3308:3306'
    expose:
      - '3306'
    volumes:
      - db:/var/run/MysqLd
    logging:
            driver: none
    ports:
      - "3307:3306"
  redis:
    image: redis:4.0-alpine
    command: redis-server
    volumes:
      - redis:/data
    ports:
      - 6379
    logging:
            driver: none
  web:
    build:
      context: ../
      dockerfile: Dockerfile
    command: bundle exec rails s -p 3000 -e development -b '0.0.0.0'
    environment:
     DB_USERNAME: root
     DB_PASSWORD: root
     DB_NAME: rs_db_dev
     DB_PORT: 3306
     DB_HOST: db
     RAILS_ENV: development
     RAILS_MAX_THREADS: 5
     REdis_HOST: redis
     REdis_PORT: 6379
     BUNDLE_PATH: /bundle
    volumes:
      - ../:/project
      - bundle:/bundle
    ports:
      - "3002:3000"
    depends_on:
      - "db"
      - "redis"
volumes:
  db:
  bundle:
  redis:

解决方法

我不确定发生了什么以及为什么,但我尝试在我的 rails 容器上执行此操作,但我不再收到上述错误。

  1. docker-compose run --rm <container> bash
  2. cd to project directory
  3. bundle install

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。