docker映像“web”似乎失败,因为映像是使用以下错误代码生成的:
web_1 | Traceback (most recent call last):
web_1 | 2: from /usr/local/bin/bundle:23:in `<main>'
web_1 | 1: from /usr/local/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
web_1 | /usr/local/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.2.24) required by your /prospector/Gemfile.lock. (Gem::GemNotFoundException)
web_1 | To update to the latest version installed on your system, run `bundle update --bundler`.
web_1 | To install the missing version, run `gem install bundler:2.2.24`
prospector_web_1 exited with code 1
docker抱怨找不到bundler的正确版本,但您可以从下面的输出中看到,我显然安装了bundler的正确版本:
masonmings@macbook-pro-10 prospector % rvm --version
rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
masonmings@macbook-pro-10 prospector % ruby --version
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin20]
masonmings@macbook-pro-10 prospector % docker --version
Docker version 20.10.7, build f0df350
masonmings@macbook-pro-10 prospector % bundle --version
Bundler version 2.2.24
masonmings@macbook-pro-10 prospector % which ruby
/Users/masonmings/.rvm/rubies/ruby-2.6.5/bin/ruby
masonmings@macbook-pro-10 prospector % which bundle
/Users/masonmings/.rvm/gems/ruby-2.6.5/bin/bundle
masonmings@macbook-pro-10 prospector % bundler --version
Bundler version 2.2.24
masonmings@macbook-pro-10 prospector % which bundler
/Users/masonmings/.rvm/gems/ruby-2.6.5/bin/bundler
我已经运行了错误消息的建议命令,但它们也没有帮助。我试着按照[本页][1]、[本页][2]、[本页][3]和其他几页上的说明进行操作,但似乎无法在网上找到解决此问题的方法。我还卸载、删除并重新处理了所有内容。任何帮助都将不胜感激。谢谢
这里有更多的上下文:
此图像的docker-compose.yml文件如下所示:
web:
build:
context: ./
dockerfile: ./docker/Dockerfile-web
env_file:
- .env
command: bundle exec rails s -p 3000 -b '0.0.0.0'
# command: tail -f /dev/null # Keeps container running
volumes:
- ./:/prospector
- ./tmp/bundle:/bundle # Gem cache
ports:
- 3000:3000 # Server
depends_on:
- postgres
- redis
links:
- postgres
- redis
- selenium
restart: always
stdin_open: true # Allows attaching for byebug
tty: true # Allows attaching for byebug
dockerfile web的外观如下所示:
###
# Dockerfile for web service, which is effectively our Rails app
#
# Based on: https://docs.docker.com/compose/rails/#define-the-project
# Use Ruby 2.6.5 Image
FROM ruby:2.6.5
# Install essentials
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
# Install NodeJS
# https://github.com/nodesource/distributions#installation-instructions
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && apt-get install -y nodejs
# Copy contents into
RUN mkdir /prospector
WORKDIR /prospector
COPY ./ /app
# Set entrypoint script, required for caching gems (so not to have redownload & rebuild every build)
# See https://medium.com/@cristian_rivera/cache-rails-bundle-w-docker-compose-45512d952c2d
COPY ./docker/docker-entrypoint-web.sh /
RUN chmod +x /docker-entrypoint-web.sh
ENTRYPOINT ["/docker-entrypoint-web.sh"]
# Set env variables for caching gems
ENV BUNDLE_PATH=/bundle
ENV BUNDLE_BIN=/bundle/bin
ENV GEM_HOME=/bundle
ENV PATH="${BUNDLE_BIN}:${PATH}"
.zshrc如下所示:
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export Path="$PATH:$HOME/.rvm"
.bashrc如下所示:
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$PATH:$HOME/.rvm"
export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
bundle env的输出为:
环境
Bundler 2.2.24
Platforms ruby, x86_64-darwin-20
Ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin20]
Full Path /Users/masonmings/.rvm/rubies/ruby-2.6.5/bin/ruby
Config Dir /Users/masonmings/.rvm/rubies/ruby-2.6.5/etc
RubyGems 3.2.24
Gem Home /Users/masonmings/.rvm/gems/ruby-2.6.5
Gem Path /Users/masonmings/.rvm/gems/ruby-2.6.5:/Users/masonmings/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
User Home /Users/masonmings
User Path /Users/masonmings/.gem/ruby/2.6.0
Bin Dir /Users/masonmings/.rvm/gems/ruby-2.6.5/bin
Tools
Git 2.30.1 (Apple Git-130)
RVM 1.29.12-next (master)
rbenv not installed
chruby not installed
rubygems-bundler (1.4.5)
绑定器生成元数据
Built At 2021-07-15
Git SHA d78b1ee235
Released Version true
捆绑机设置
cache_all
Set for your local app (/Users/masonmings/Camber Code/prospector/.bundle/config): true
gemfile
gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.5'
# Application
gem 'rails', '~> 5.2.3' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'pg', '>= 0.18', '< 2.0' # Use postgresql as the database for Active Record
gem 'puma', '~> 3.11' # Use Puma as the app server
gem 'sass-rails', '~> 5.0' # Use SCSS for stylesheets
gem 'uglifier', '>= 1.3.0' # Use Uglifier as compressor for JavaScript assets
gem 'turbolinks', '~> 5' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'jbuilder', '~> 2.5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'redis', '~> 4.0' # Use Redis adapter to run Action Cable in production
gem 'bootsnap', '>= 1.1.0', require: false # Reduces boot times through caching; required in config/boot.rb
gem 'sidekiq', '~> 5.2', '>= 5.2.7' # Simple, efficient background processing for Ruby.
# Data
gem 'enumerize', '~> 2.3', '>= 2.3.1' # Enums / Enumerated attributes with I18n
gem 'rails-settings-cached', '~> 2.0', '>= 2.0.3' # Settings plugin for Rails that makes managing a table of global key, value pairs easy
gem 'chronic', '~> 0.10.2' # Natural language date/time parser
gem 'kaminari', '~> 1.1', '>= 1.1.1' # Cclean, powerful, agnostic, customizable and sophisticated paginator
# UI
gem 'bootstrap', '~> 4.3', '>= 4.3.1' # Bootstrap, as we all know too well
gem 'jquery-rails', '~> 4.3', '>= 4.3.3' # JQuery for Rails
gem 'rouge', '~> 3.7' # Code highlighter
# Authentication
gem 'omniauth', '~> 1.9' # OmniAuth is a flexible authentication system utilizing Rack middleware
gem 'omniauth-google-oauth2' # A Google OAuth2 strategy for OmniAuth 1.x. This allows you to login to Google
# Services
gem 'google-cloud-bigquery' # Google Big Query
gem 'sentry-raven' # Sentry exception monitoring service
gem 'pipedrive.rb', github: 'amoniacou/pipedrive.rb', ref: '1000a6f' # Pipedrive.com API Wrapper
# Utility
gem 'dotenv-rails' # Load environment variables from `.env`
gem 'httparty', '~> 0.17.0' # Makes http fun again!
gem 'annotate', '~> 2.7', '>= 2.7.5' # Annotates Rails/ActiveRecord Models
gem 'net-ssh', '~> 5.2' # Pure Ruby implementation of the SSH2 client protocol
gem 'highline', '~> 2.0', '>= 2.0.2' # A high level command-line oriented interface
# Scraping
gem 'watir', '~> 6.16', '>= 6.16.5' # Interact with browsers the same way people do!
gem 'watir-webdriver-performance' # Collects and summarises metrics for Watir
gem 'capybara', '>= 2.15' # Acceptance test framework for web applications
gem 'selenium-webdriver' # A browser automation framework and ecosystem
gem 'webdrivers', '~> 4.0' # Keep your Selenium WebDrivers updated automatically
# Development & Test
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'pry'
end
# Development
group :development do
gem 'capistrano', '~> 3.11', require: false # Utility and framework for executing commands in parallel via SSH (read: deploying)
gem 'capistrano-decompose', github: 'Whelton/capistrano-decompose', ref: '030b9c5' # Capistrano plugin to deploy your application inside docker containers with docker compose
gem 'web-console', '>= 3.3.0' # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'listen', '>= 3.0.5', '< 3.2' # Listens to file modifications and notifies you about the changes
gem 'spring' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring-watcher-listen', '~> 2.0.0' # Spring x Listen
end
gemfile.lock
GIT
remote: https://github.com/Whelton/capistrano-decompose.git
revision: 030b9c5b96ef03d411aa1a9de661e4ef2041bff1
ref: 030b9c5
specs:
capistrano-decompose (0.2.0)
capistrano (~> 3.5)
GIT
remote: https://github.com/amoniacou/pipedrive.rb.git
revision: 1000a6f930a55ad81d96f876478c6fc3bf38a28a
ref: 1000a6f
specs:
pipedrive.rb (0.1.0)
activesupport (>= 4.0.0)
faraday
faraday_middleware
hashie (>= 3.0)
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.6)
actionpack (= 5.2.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
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.6)
activesupport (= 5.2.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.6)
activesupport (= 5.2.6)
globalid (>= 0.3.6)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
marcel (~> 1.0.0)
activesupport (5.2.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
annotate (2.7.5)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 13.0)
arel (9.0.0)
autoprefixer-rails (10.2.5.1)
execjs (> 0)
bindex (0.8.1)
bootsnap (1.7.5)
msgpack (~> 1.0)
bootstrap (4.6.0)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
builder (3.2.4)
byebug (11.1.3)
capistrano (3.16.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capybara (3.35.3)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (3.0.0)
chronic (0.10.2)
coderay (1.1.3)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
crass (1.0.6)
declarative (0.0.20)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
enumerize (2.4.0)
activesupport (>= 3.2)
erubi (1.10.0)
execjs (2.8.1)
faraday (1.5.1)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
ffi (1.15.3)
globalid (0.4.2)
activesupport (>= 4.2.0)
google-apis-bigquery_v2 (0.15.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
webrick
google-cloud-bigquery (1.34.0)
concurrent-ruby (~> 1.0)
google-apis-bigquery_v2 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.1.0)
googleauth (0.16.2)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
hashie (4.1.0)
highline (2.0.3)
httparty (0.17.3)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jbuilder (2.11.2)
activesupport (>= 5.0.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jwt (2.2.3)
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)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.10.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
memoist (0.16.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0704)
mini_mime (1.1.0)
mini_portile2 (2.5.3)
minitest (5.14.4)
msgpack (1.4.2)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (5.2.0)
nio4r (2.5.7)
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
oauth2 (1.4.7)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.9.1)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-google-oauth2 (0.8.2)
jwt (>= 2.0)
oauth2 (~> 1.1)
omniauth (~> 1.1)
omniauth-oauth2 (>= 1.6)
omniauth-oauth2 (1.7.1)
oauth2 (~> 1.4)
omniauth (>= 1.9, < 3)
os (1.1.1)
pg (1.2.3)
popper_js (1.16.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
puma (3.12.6)
racc (1.5.2)
rack (2.2.3)
rack-protection (2.1.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
bundler (>= 1.3.0)
railties (= 5.2.6)
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)
rails-settings-cached (2.7.1)
rails (>= 5.0.0)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (12.3.3)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.1.4)
regexp_parser (2.1.1)
representable (3.1.1)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.5)
rouge (3.26.0)
ruby2_keywords (0.0.5)
ruby_dep (1.5.0)
rubyzip (2.3.2)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 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)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
sentry-raven (3.1.2)
faraday (>= 1.0)
sidekiq (5.2.9)
connection_pool (~> 2.2, >= 2.2.2)
rack (~> 2.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 4.2)
signet (0.15.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
spring (2.1.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.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
thor (1.1.0)
thread_safe (0.3.6)
tilt (2.0.10)
trailblazer-option (0.1.1)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
uber (0.1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
watir (6.19.1)
regexp_parser (>= 1.2, < 3)
selenium-webdriver (>= 3.142.7)
watir-webdriver (0.9.9)
selenium-webdriver (>= 2.46.2)
watir-webdriver-performance (0.2.4)
watir-webdriver
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webdrivers (4.6.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
PLATFORMS
ruby
DEPENDENCIES
annotate (~> 2.7, >= 2.7.5)
bootsnap (>= 1.1.0)
bootstrap (~> 4.3, >= 4.3.1)
byebug
capistrano (~> 3.11)
capistrano-decompose!
capybara (>= 2.15)
chronic (~> 0.10.2)
dotenv-rails
enumerize (~> 2.3, >= 2.3.1)
google-cloud-bigquery
highline (~> 2.0, >= 2.0.2)
httparty (~> 0.17.0)
jbuilder (~> 2.5)
jquery-rails (~> 4.3, >= 4.3.3)
kaminari (~> 1.1, >= 1.1.1)
listen (>= 3.0.5, < 3.2)
net-ssh (~> 5.2)
omniauth (~> 1.9)
omniauth-google-oauth2
pg (>= 0.18, < 2.0)
pipedrive.rb!
pry
puma (~> 3.11)
rails (~> 5.2.3)
rails-settings-cached (~> 2.0, >= 2.0.3)
rouge (~> 3.7)
sass-rails (~> 5.0)
selenium-webdriver
sentry-raven
sidekiq (~> 5.2, >= 5.2.7)
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
uglifier (>= 1.3.0)
watir (~> 6.16, >= 6.16.5)
watir-webdriver-performance
web-console (>= 3.3.0)
webdrivers (~> 4.0)
RUBY VERSION
ruby 2.6.5p114
BUNDLED WITH
2.2.24
...
[1]: https://bundler.io/doc/troubleshooting.html
[2]: https://bundler.io/blog/2019/05/14/solutions-for-cant-find-gem-bundler-with-executable-bundle.html
[3]: https://github.com/rbenv/rbenv/issues/1138
暂无答案!
目前还没有任何答案,快来回答吧!