本文介绍了在带有Docker-Compose的FuzzApi上的任何源代码(bundler::GemNotFound)中找不到rake-12.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试在Kali上使用docker-compose build
命令构建FuzzApidocker实例时,出现以下错误:
Step 10/11 : RUN bundle exec rake db:migrate
---> Running in f2aac66b88d7
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:94:in `block in materialize': Could not find rake-12.0.0 in any of the sources (Bundler::GemNotFound)
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `map!'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `materialize'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in `specs_for'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in `requested_specs'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in `requested_specs'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in `setup'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
ERROR: Service 'sidekiq' failed to build: The command '/bin/sh -c bundle exec rake db:migrate' returned a non-zero code: 1
我用gem list --local
查看了本地gem,rake版本似乎是13.0.1,是这样还是别的什么?
编辑:文档文件如下:
FROM ruby:2.3.0
# Install apt based dependencies required to run Rails as
# well as RubyGems. As the Ruby image itself is based on a
# Debian image, we use apt-get to install those.
RUN apt-get update && apt-get install -y
build-essential
nodejs
# Configure the main working directory. This is the base
# directory used in any further RUN, COPY, and ENTRYPOINT
# commands.
RUN mkdir -p /app
WORKDIR /app
# Copy the Gemfile as well as the Gemfile.lock and install
# the RubyGems. This is a separate step so the dependencies
# will be cached unless changes to one of those two files
# are made.
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install --jobs 20 --retry 5
# Copy the main application.
COPY . ./
# Expose port 3000 to the Docker host, so we can access it
# from the outside.
EXPOSE 3000
# Configure an entry point, so we don't need to specify
# "bundle exec" for each of our commands.
ENTRYPOINT ["bundle", "exec"]
# To resolve the error: PendingMigrationError
RUN bundle exec rake db:migrate
# The main command to run when the container starts. Also
# tell the Rails dev server to bind to all interfaces by
# default.
CMD ["rails", "server", "-b", "0.0.0.0"]
推荐答案
在您的Docker文件的第35行添加以下内容:
RUN gem install rake && bundle install
这样最后一块看起来就像:
# To resolve the error: PendingMigrationError
RUN gem install rake && bundle install
RUN bundle exec rake db:migrate
原始文件:
https://github.com/Fuzzapi/fuzzapi/blob/master/Dockerfile#L35
我的更改:
https://github.com/v4lerio/fuzzapi/blob/master/Dockerfile#L35
我的拉取请求:
https://github.com/Fuzzapi/fuzzapi/pull/102
这篇关于在带有Docker-Compose的FuzzApi上的任何源代码(bundler::GemNotFound)中找不到rake-12.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!