Skip to content

CodespaceでRubyバージョン不一致によりアプリが起動できない問題 #98

@TORIFUKUKaiou

Description

@TORIFUKUKaiou

CodespaceでRubyバージョン不一致によりアプリが起動できない問題をご報告いたします。

概要

7_0/ のch14をCodespaceで動かそうとすると、「Your Ruby version is 3.2.9, but your Gemfile specified 3.2.8」により、動きませんでした。
もう少し事象を説明すると、bundle installが止まります。手動で再実行しても、上記と同じメッセージで止まります。

7_0/のch14でのみ確認していますが、どのチャプターもGemfileの中は3.2.8を指定しているため、同様に発生するものと思われます。

原因調査(というほどのこともありませんが、ほんの少し調べたことです)

.devcontainer/devcontainer.json で指定している「mcr.microsoft.com/devcontainers/ruby:3.2」がつい先日、Ruby 3.2.9にあがっています。

暫定的な対処

暫定的な対処として、mcr.microsoft.com/devcontainers/ruby:3.2.8 といった形では公開されていないので、DockerHubにあるruby:3.2.8を指定すると、7_0/ch14が動作することを確認いたしました。

参考情報 (mcr.microsoft.com/devcontainers/ruby:3.2)

mcr.microsoft.com/devcontainers/ruby:3.2」のinspectです。

  • "Created": "2025-09-03T17:19:01.524938932Z"
  • "RUBY_VERSION=3.2.9"
docker image pull mcr.microsoft.com/devcontainers/ruby:3.2
docker image inspect mcr.microsoft.com/devcontainers/ruby:3.2
[
    {
        "Id": "sha256:accbb3819921c2091661b622987df42c7a7ad2b463ebefce476e1d81561e9108",
        "RepoTags": [
            "mcr.microsoft.com/devcontainers/ruby:3.2"
        ],
        "RepoDigests": [
            "mcr.microsoft.com/devcontainers/ruby@sha256:accbb3819921c2091661b622987df42c7a7ad2b463ebefce476e1d81561e9108"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2025-09-03T17:19:01.524938932Z",
        "DockerVersion": "",
        "Author": "",
        "Architecture": "arm64",
        "Os": "linux",
        "Size": 548165362,
        "GraphDriver": {
            "Data": null,
            "Name": "overlayfs"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:01208eec12aff6200b2d5dab35cd6771a332af0db8d0b2d8755f7257775bc5a9",
                "sha256:6cca669e89b20075a8947591d8d129c5cb3fd3450242420a98af18929e6cbd17",
                "sha256:47da3a525ec41fa00fba1686aed99514b96574467a736c12bdbf4a66f1dd72a2",
                "sha256:7279b045fa8f8461d4ae05609186521fbd13aa9501c5b9a3507c97700d113ef2",
                "sha256:f638eb7350fe6ffef4c77e4817b0a20cac16609ef4439041945f2ec007e22b66",
                "sha256:73073e677756f1334ceb60a3597d80b06dba30997d10fca41c6054c9ab5682c6",
                "sha256:0f400dc508be79dd10c0c39996801722565b9c0fe625fad02431dd64a24bcbfd",
                "sha256:360f10006459464c606335883e071057d7ca26eae3f63f8be01032e4aa54d198",
                "sha256:eae125e1520d1981fc1812b84d6a6ebad7fe3d0f53e9b88ae7804187d7b90856",
                "sha256:cceea5014f20a95f28acf98e616f6c21f18121f1d56a58f172e7e4850176cfe6",
                "sha256:7571a00cfa736746665a0e51f941fd81083b73e00cfc835d2c31ae03addb4079",
                "sha256:42b08001cd8353882cd5db3cb0130bcda52fd83d15c4e81984c7f95d1034da11",
                "sha256:8baec2e7a500b3acce35b97625b0b13756b10456962ae50c715b9fdb098a14e0",
                "sha256:081a0102f61c06af0d4b506a6f001d7b7e9d8190ae4e1d89a1043f216d879303",
                "sha256:b525b4f26a7c6cf98f2483ab2f7ef09a01df4bba6ff5e00200bea5f848effd2e",
                "sha256:642833ab39ba0e025b63e4891cb9ece0accc5440cc296f059525a1f032464dee",
                "sha256:6138fa9f38863002cdd21203a50b33dca75d14af2847f5ae4ca075c289c36423",
                "sha256:6d336193c88470948bef30aa24c7e3de97deab51758f29b5cba57f2c43ef470e",
                "sha256:ef79f62d30cf25861b7926ad17f57ac4e2c310e995ff45c8bbe2e5daf4dffbaa"
            ]
        },
        "Metadata": {
            "LastTagTime": "2025-09-04T22:26:37.654361924Z"
        },
        "Descriptor": {
            "mediaType": "application/vnd.oci.image.index.v1+json",
            "digest": "sha256:accbb3819921c2091661b622987df42c7a7ad2b463ebefce476e1d81561e9108",
            "size": 1609
        },
        "Config": {
            "Cmd": [
                "irb"
            ],
            "Entrypoint": null,
            "Env": [
                "PATH=/usr/local/rvm/gems/default/bin:/usr/local/rvm/gems/default@global/bin:/usr/local/rvm/rubies/default/bin:/usr/local/share/rbenv/bin:/usr/local/share/nvm/current/bin:/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "RUBY_VERSION=3.2.9",
                "RUBY_DOWNLOAD_URL=https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.9.tar.xz",
                "RUBY_DOWNLOAD_SHA256=cf6699d0084c588e7944d92e1a8edda28b1cc3ee471a1f0aebb4b3d32c9753b2",
                "GEM_HOME=/usr/local/rvm/gems/default",
                "BUNDLE_SILENCE_ROOT_WARNING=1",
                "BUNDLE_APP_CONFIG=/usr/local/bundle",
                "NVM_DIR=/usr/local/share/nvm",
                "NVM_SYMLINK_CURRENT=true",
                "GEM_PATH=/usr/local/rvm/gems/default:/usr/local/rvm/gems/default@global",
                "MY_RUBY_HOME=/usr/local/rvm/rubies/default"
            ],
            "Labels": {
                "dev.containers.id": "ruby",
                "dev.containers.release": "v0.4.18",
                "dev.containers.source": "https://github.com/devcontainers/images",
                "dev.containers.timestamp": "Wed, 03 Sep 2025 16:00:34 GMT",
                "dev.containers.variant": "3.2-trixie",
                "devcontainer.metadata": "[ {\"id\":\"ghcr.io/devcontainers/features/common-utils:2\"}, {\"id\":\"ghcr.io/devcontainers/features/git:1\",\"customizations\":{\"vscode\":{\"settings\":{\"github.copilot.chat.codeGeneration.instructions\":[{\"text\":\"This dev container includes an up-to-date version of Git, built from source as needed, pre-installed and available on the `PATH`.\"}]}}}}, {\"id\":\"ghcr.io/devcontainers/features/node:1\",\"customizations\":{\"vscode\":{\"extensions\":[\"dbaeumer.vscode-eslint\"],\"settings\":{\"github.copilot.chat.codeGeneration.instructions\":[{\"text\":\"This dev container includes `node`, `npm` and `eslint` pre-installed and available on the `PATH` for Node.js and JavaScript development.\"}]}}}}, {\"id\":\"ghcr.io/devcontainers/features/ruby:1\",\"customizations\":{\"vscode\":{\"extensions\":[\"shopify.ruby-lsp\"],\"settings\":{\"github.copilot.chat.codeGeneration.instructions\":[{\"text\":\"This dev container includes Ruby, rvm, rbenv, common Ruby utilities, and needed dependencies pre-installed and available on the `PATH`, along with the Ruby language extension for Ruby development.\"}]}}}}, {\"remoteUser\":\"vscode\"} ]",
                "version": "2.0.1"
            },
            "OnBuild": null,
            "User": "root",
            "Volumes": null,
            "WorkingDir": ""
        }
    }
] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions