我在Docker中运行了一个Rails应用程序。我有两个连接的图像。我无法运行其中一个的服务器,它工作正常,但我不能运行另一个,简单命令都不起作用。它无法告诉我无法在任何来源中找到rake-12.3.1。
There is already existing solution
上述链接中没有任何解决方案无效。
bundler: failed to load command: puma (/usr/local/bundle/bin/puma)
Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
source 'https://rubygems.org'
gem 'rails', '~> 4.2'
gem 'rails-i18n'
gem 'responders', '~> 2.0'
gem 'puma'
gem 'mysql2', '~> 0.3.21'
gem 'redis-rails'
gem 'json'
gem 'jbuilder'
gem 'omniauth', '~> 1.8.1'
gem 'omniauth-auth0', '~> 2.0.0'
gem 'omniauth-google-oauth2', '~> 0.5.2'
gem 'omniauth-barong', '~> 0.1.2'
gem 'figaro'
gem 'hashie', '~> 3.0'
gem 'aasm', '~> 4.12'
gem 'bunny', '~> 2.9.0'
gem 'cancancan'
gem 'enumerize'
gem 'datagrid'
gem 'kaminari'
gem 'paranoid2'
gem 'active_hash'
gem 'http_accept_language'
gem 'paper_trail', '~> 3.0.1'
gem 'rails-observers'
gem 'country_select', '~> 2.1.0'
gem 'gon', '~> 5.2.0'
gem 'pusher'
gem 'eventmachine', '~> 1.0.4'
gem 'em-websocket', '~> 0.5.1'
gem 'simple_form', '~> 3.1.0'
gem 'slim-rails'
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier', '~> 4.1'
gem 'jquery-rails'
gem 'angularjs-rails', '~> 1.3.15'
gem 'bootstrap-sass', '~> 3.2.0.2'
gem 'font-awesome-sass'
gem 'bourbon'
gem 'momentjs-rails'
gem 'eco'
gem 'browser', '~> 0.8.0'
gem 'rbtree'
gem 'liability-proof', '0.0.9'
gem 'grape', '~> 1.0.1'
gem 'grape-entity', '~> 0.5.2'
gem 'grape-swagger', '~> 0.27.3'
gem 'grape-swagger-ui', '~> 2.2.8'
gem 'rack-attack', '~> 4.3.1'
gem 'easy_table'
gem 'faraday', '~> 0.12'
gem 'jwt', '~> 1.5'
gem 'email_validator', '~> 1.6'
gem 'clipboard-rails', '~> 1.7'
gem 'god', '~> 0.13.7', require: false
gem 'mini_racer', '~> 0.1', require: false
gem 'arel-is-blank', '~> 1.0'
gem 'sentry-raven', '~> 2.7', require: false
gem 'memoist', '~> 0.16'
gem 'method-not-implemented', '~> 1.0'
gem 'passgen', '~> 1.0'
gem 'validates_lengths_from_database', '~> 0.7.0'
group :development, :test do
gem 'factory_bot_rails'
gem 'faker', '~> 1.4.3'
gem 'binding_of_caller'
gem 'quiet_assets'
gem 'timecop'
gem 'rspec-rails', '~> 3.7'
gem 'pry-byebug'
end
group :development do
gem 'annotate', '~> 2.7'
end
group :test do
gem 'database_cleaner'
gem 'mocha', require: false
gem 'capybara', '~> 2.17'
gem 'selenium-webdriver', '~> 3.8'
gem 'chromedriver-helper', '~> 1.1'
gem 'rack_session_access', '~> 0.1'
gem 'webmock', '~> 3.3'
end
FROM ruby:2.5.0
MAINTAINER lbellet@heliostech.fr
ARG RAILS_ENV=production
ENV RAILS_ENV ${RAILS_ENV}
ENV APP_HOME=/home/app
RUN groupadd -r app --gid=1000
RUN useradd -r -m -g app -d /home/app --uid=1000 app
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/source$
&& apt-get update \
&& apt-get install -y \
default-libmysqlclient-dev \
imagemagick \
gsfonts \
chromedriver \
nodejs \
yarn
WORKDIR $APP_HOME
COPY Gemfile Gemfile.lock $APP_HOME/
# Install dependencies
RUN mkdir -p /opt/vendor/bundle && chown -R app:app /opt/vendor
RUN su app -s /bin/bash -c "bundle install --path /opt/vendor/bundle"
# Copy the main application.
COPY . $APP_HOME
RUN chown -R app:app /home/app
USER app
RUN ./bin/init_config \
&& chmod +x ./bin/logger \
&& bundle exec rake tmp:create yarn:install assets:precompile
# Expose port 8080 to the Docker host, so we can access it
# from the outside.
EXPOSE 8080
ENTRYPOINT ["bundle", "exec"]
# The main command to run when the container starts. Also
# tell the Rails dev server to bind to all interfaces by
# default.
CMD ["puma", "--config", "config/puma.rb"]
我尝试重新安装docker,更改ruby版本,删除Gemfile.lock,但似乎没有任何工作。我该如何解决?
答案 0 :(得分:4)
遇到类似情况,这对我有用:
bundle install --binstubs
答案 1 :(得分:0)
我认为您需要从自制软件更新rbenv-bundler
。
尝试:
brew upgrade rbenv-bundler
然后,尝试安装gem。
gem install rake -v 12.3.1