我正在尝试运行一个docker容器,但由于该错误而失败:
app_1 | rake aborted!
app_1 | LoadError: cannot load such file -- fugit
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:41:in `rescue in require'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
app_1 | /usr/local/bundle/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
app_1 | /usr/local/bundle/gems/activesupport-5.2.4/lib/active_support/dependencies.rb:291:in `block in require'
app_1 | /usr/local/bundle/gems/activesupport-5.2.4/lib/active_support/dependencies.rb:257:in `load_dependency'
app_1 | /usr/local/bundle/gems/activesupport-5.2.4/lib/active_support/dependencies.rb:291:in `require'
app_1 | /usr/local/bundle/gems/rufus-scheduler-3.6.0/lib/rufus/scheduler.rb:7:in `<top (required)>'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
app_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
app_1 | /usr/local/bundle/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
app_1 | /usr/local/bundle/gems/activesupport-5.2.4/lib/active_support/dependencies.rb:291:in `block in require'
app_1 | /usr/local/bundle/gems/activesupport-5.2.4/lib/active_support/dependencies.rb:257:in `load_dependency'
...
sidekiq_1 | /usr/local/bundle/gems/activesupport-5.2.4/lib/active_support/dependencies.rb:291:in `require'
sidekiq_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:49:in `require_relative'
sidekiq_1 | /usr/local/bundle/gems/sidekiq-scheduler-3.0.1/lib/sidekiq-scheduler.rb:4:in `<top (required)>'
sidekiq_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
sidekiq_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
sidekiq_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
sidekiq_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
sidekiq_1 | /usr/local/bundle/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
sidekiq_1 | /usr/local/bundle/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
sidekiq_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
sidekiq_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in `each'
sidekiq_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in `block in require'
sidekiq_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in `each'
sidekiq_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in `require'
sidekiq_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler.rb:114:in `require'
sidekiq_1 | /myapp/config/application.rb:7:in `<top (required)>'
sidekiq_1 | /myapp/rakefile:4:in `require_relative'
sidekiq_1 | /myapp/rakefile:4:in `<top (required)>'
sidekiq_1 | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
sidekiq_1 |
sidekiq_1 | Caused by:
sidekiq_1 | Bootsnap::LoadPathCache::FallbackScan:
sidekiq_1 |
sidekiq_1 | (See full trace by running task with --trace)
sidekiq_1 | rake aborted!
我的Gemfile中没有此文件,尽管我相信它可能是由sidekiq-scheduler
或bootsnap
gem引起的。
这是我的gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# 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 'rb-readline'
end
# group :production do
# gem 'mysql2'
# end
gem 'pg'
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
#letter opener
gem 'letter_opener'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'bullet'
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 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Bootstrap
gem 'bootstrap'
# JQuery
gem 'jquery-rails'
gem 'jquery-ui-rails'
#toastr
gem 'toastr_rails'
# Used for server-side processing of datatables.
gem 'jquery-datatables-rails'
gem 'ajax-datatables-rails'
# Ability to debug code in real time.
gem 'pry'
# Used for mass imports.
gem 'activerecord-import', git: "https://github.com/zdennis/activerecord-import"
# Sidekiq used for backgrounding tasks.
gem 'sidekiq'
gem 'sidekiq-scheduler'
# CSV parsing.
gem 'csv'
# Text editor.
gem 'ckeditor_rails'
#user authentication
gem 'devise'
#for document validation
gem 'activestorage-validator'
# Generates a visual diagram to represent model relationships.
gem 'railroady'
#for date range picker
gem 'momentjs-rails'
gem 'bootstrap-daterangepicker-rails'
#datepicker
gem 'bootstrap-datepicker-rails'
#date-time-picker
gem 'bootstrap3-datetimepicker-rails'
#tag input
gem 'bootstrap-tagsinput-rails'
#bootstrap slider
gem 'bootstrap-slider-rails'
#pagination
gem 'will_paginate'
#nested associations
gem "cocoon"
# Convert number to words.
gem 'humanize'
# HTML to PDF conversion
gem 'wicked_pdf'
#gem 'wkhtmltopdf-binary'
# Slack-ruby-client
gem 'slack-ruby-client'
gem 'eventmachine'
gem 'faye-websocket'
gem 'rails_best_practices'
# Message implementation
gem 'twilio-ruby'
# For sidekiq web
gem 'rack', '2.0.7'
# For detecting mime types
gem 'mime'
# to call the api from rails application
gem 'rest-client'
gem 'activerecord-session_store'
# To get the next available day after a provided day
gem 'chronic'
# To get current season for password attacks
gem 'ruby-seasons'
#active storage validation
gem 'active_storage_validations'
# necessary for AWS client
gem 'aws-sdk-rails'
gem 'aws-sdk-ec2'
gem 'terminal-table'
gem 'time_difference'
# For PDF generation
gem 'grover'
我遗漏了什么,导致尝试站起Docker容器时会发生此错误?我不明白为什么它不会在docker容器中的任何地方失败。
据我所知,运行rake db:migrate
时会发生这种情况,因为它显示“ rake aborted”
我也尝试过删除bootsnap
gem,因为很多错误都引用了它,但是没有运气。仍然出现相同的错误。
这是我的Dockerfile:
FROM ruby:2.5.1-alpine
ENV BUNDLER_VERSION=2.0.2
RUN apk add --update --no-cache \
binutils-gold \
build-base \
curl \
file \
g++ \
gcc \
git \
less \
libstdc++ \
libffi-dev \
libc-dev \
linux-headers \
libxml2-dev \
libxslt-dev \
libgcrypt-dev \
make \
netcat-openbsd \
nodejs \
openssl \
pkgconfig \
postgresql-dev \
python \
tzdata \
yarn
RUN gem install bundler -v 2.0.2
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle config build.nokogiri --use-system-libraries
RUN bundle check || bundle install
COPY . /myapp
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 80
CMD ["rails", "server", "-b", "0.0.0.0", "-p", "80"]