ruby-on-rails-4 – Docker rails 4:,奇怪的错误:RUN bundle e
发布时间:2020-12-17 02:08:22 所属栏目:百科 来源:网络整理
导读:尝试使用Docker部署rails4应用程序,我在以下Dockerfile中: FROM ubuntu:14.04RUN apt-get update apt-get install -qy software-properties-commonRUN apt-add-repository -y ppa:brightbox/ruby-ngRUN apt-get update apt-get upgrade -y# Ruby and depe
尝试使用Docker部署rails4应用程序,我在以下Dockerfile中:
FROM ubuntu:14.04 RUN apt-get update && apt-get install -qy software-properties-common RUN apt-add-repository -y ppa:brightbox/ruby-ng RUN apt-get update && apt-get upgrade -y # Ruby and dependencies RUN apt-get install -qy curl nodejs libmysqlclient-dev libsqlite3-dev libpq-dev build-essential ruby2.2 ruby2.2-dev RUN gem install bundler --no-ri --no-rdoc # Cache bundle install WORKDIR /tmp ADD Gemfile Gemfile ADD Gemfile.lock Gemfile.lock RUN bundle install --without development test # Add rails project to project directory ADD ./ /rails # set WORKDIR WORKDIR /rails RUN bundle exec rake assets:precompile # Cleanup RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Publish port 8080 EXPOSE 8080 在我的docker-compose.ml中,我的服务定义为使用此Dockerfile构建它 .... web: build: . .... 但是构建失败了: service 'web' failed to build: The command '/bin/sh -c bundle exec rake assets:precompile' returned a non-zero code: 1 根据控制台,错误是: ---> Running in 32c12f52e507 /var/lib/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find debug_inspector-0.0.2 in any of the sources (Bundler::GemNotFound) 我在Gemfile中添加了gem, gem 'debug_inspector','~> 0.0.2' 我将它捆绑并重建..现在又为另一个丢失的gem引发了另一个错误: var/lib/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find binding_of_caller-0.7.2 in any of the sources (Bundler::GemNotFound) 我不明白发生了什么……我忘了避免这种重复错误的原因是什么? 感谢帮助 解决方法
我改变了我的Dockerfle
RUN bundle install --without development test 至 RUN bundle install 这些宝石是开发环境所必需的…… (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |