困っていること
vscodeの拡張機能であるdockerで「Docker: Add Docker Files to Worksspace」(今回はrubyを選択)を実行して、Dockerfile等が自動生成された状態で「docker-compose」を実行した場合、エラーが発生しサクセスしません。
エラー内容
cmd
1Your bundle only supports platforms [] but your local platforms are ["ruby", 2"x86_64-linux"], and there's no compatible match between those two lists. 3ERROR: Service 'docker_rails' failed to build: The command '/bin/sh -c bundle install' returned a non-zero code: 16
翻訳
google翻訳
1バンドルはプラットフォーム[]のみをサポートしますが、ローカルプラットフォームは["ruby"、「x86_64-linux」]、およびこれらの2つのリスト間に互換性のある一致はありません。 2エラー:サービス 'docker_rails'の構築に失敗しました:コマンド '/ bin / sh -c bundle install'はゼロ以外のコードを返しました:16
質問
原因と解決方法がわかる方、ご教授くださいm(__)m
googleで調べたらヒントはもらえましたが、なにせwindows環境なので解決までは至りませんでした。
参考サイト
- How can I resolve “Your bundle only supports platforms [”x86-mingw32“] but your local platforms are [”ruby“, ”x86_64-linux“]”
- Bad error when installing with --deployment without a lockfile
追記
Dockerfile等のファイルの載せるの忘れてました????
Dockerfile
1FROM ruby:2.5-slim 2 3LABEL Name=docker_rails Version=0.0.1 4EXPOSE 5000 5 6# throw errors if Gemfile has been modified since Gemfile.lock 7RUN bundle config --global frozen 1 8 9WORKDIR /app 10COPY . /app 11 12COPY Gemfile Gemfile.lock ./ 13RUN bundle install 14 15CMD ["ruby", "docker_rails.rb"] 16
docker-compose.yml
docker
1version: '2.1' 2 3services: 4 docker_rails: 5 image: docker_rails 6 build: . 7 ports: 8 - 5000:5000
Gemfile
1source 'https://rubygems.org' 2gem 'rails', '5.2.1'
Gemfile.lockは空のままです。
あなたの回答
tips
プレビュー