# Build fails due to ruby version mismatch

**URL:** https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317
**Category:** Self-hosting
**Created:** [February 17, 2026, 5:35am UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317 "2026-02-17T05:35:23Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 5:35am UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/1 "2026-02-17T05:35:23Z")

</div>

After some days of using  
`./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only` without issue  
I ran into issues after trying to use the rails console to set `SiteSetting.can_permanently_delete = true`  
using `./launcher enter web_only` then `rails c`

**Question:** Is the rails console accessed differently in separate container mode?

After failing to get a successful rebuild and bootstrap I rolled the server back a couple of days prior to implementing AI stuff. No joy!  
The bootstrap method fails with:

```plaintext
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3' failed with return #<Process::Status: pid 465 exit 18>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.4.0/lib/pups/exec_command.rb:138:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'", "su discourse -c 'bundle clean'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name cache -not -path \"*/gems/*\" -type d -exec rm -rf {} +'", "su discourse -c 'find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +'"]}
bootstrap failed with exit code 18
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
aee0f5c110bf8ce78f05c138a78712b4a0116fe6662c998b2f29800715036091

```

./launcher rebuild web\_only errors as well

```plaintext
docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint web_only (06b7b1f7f6b476adac20a11a55de776d7350e837407a6c7a6ba582c917f6dd73): Bind for 0.0.0.0:80

```

After updating Docker Manager from Admin I get

```plaintext
You are running an old version of the Discourse image
Updates via the web UI are disabled until you run the latest image. To do so log in to your server using SSH and run:

  cd /var/discourse
  ./launcher rebuild app

```

**Question:** You guys have any ideas on what is going on?

Here’s the error that causes the build to fail:

```plaintext
[2026-02-17T16:51:13.376629 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 17, 2026, 1:10pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/2 "2026-02-17T13:10:59Z")

</div>

You need to scroll up to find the error.

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 5:03pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/3 "2026-02-17T17:03:57Z")

</div>

Yes, I have done that but never see anything helpful.  
Here is latest.  
[exitcode18.txt](https://meta.discourse.org/uploads/short-url/ActhRPdoF7ChhLcUqRaMPybW0GS.txt) (43.5 KB)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 17, 2026, 5:19pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/4 "2026-02-17T17:19:57Z")

</div>

Here’s the error:

```plaintext
[2026-02-17T16:51:13.376629 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

```

Do you have discourse Docker pinned to an old version? Or, it could be a bug, but it seems in) unlikely that such a bug would pass the build test.

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 5:35pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/5 "2026-02-17T17:35:58Z")

</div>

Thanks Jay. I saw that but odd messages are not that uncommon with successful builds.

> [@pfaffman](#):
>
> Do you have discourse Docker pinned to an old version?

No, followed the OP as mentioned.

> [@Move from standalone container to separate web and data containers](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413/128):
>
> ./launcher bootstrap data && ./launcher destroy data && ./launcher start data fails with error unless first stopping the data container with ./launcher stop data This occurs on instances created fresh with ./discourse-setup --two-container and converted using the longer method. In both cases ./launcher stop web\_only && ./launcher rebuild data && ./launcher rebuild web\_only and ./launcher bootstrap web\_only && ./launcher destroy web\_only && ./launcher start web\_only work as expected. Am I…

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 7:15pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/6 "2026-02-17T19:15:14Z")

</div>

@pfaffman Thanks for the move!

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [February 17, 2026, 7:16pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/7 "2026-02-17T19:16:12Z")

</div>

Can you pull `/var/discourse`? The rebuild should be done using base image 2.0.20260209-1300

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 7:49pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/8 "2026-02-17T19:49:00Z")

</div>

Thanks for jumping in @supermathie

2.0.20260209-1300 is used  
from fresh `./launcher rebuild web_only`

```plaintext
Status: Downloaded newer image for discourse/base:2.0.20260209-1300
docker.io/discourse/base:2.0.20260209-1300
Ensuring launcher is up to date
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 web_only
web_only
2.0.20260209-1300: Pulling from discourse/base
Digest: sha256:50d2dae489a9c9916c3d50d880f7f1282fcbe179339b60a8947ab135c1f1f9bf
Status: Image is up to date for discourse/base:2.0.20260209-1300
docker.io/discourse/base:2.0.20260209-1300

```

end of build

```plaintext
docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint web_only (9e391a36bdc1a80a6b993a466ffdba25337ce70f1fe74f2b5d8aaca75585322b): Bind for 0.0.0.0:80 failed: port is already allocated

```

[failed to set up container networking.txt](https://meta.discourse.org/uploads/short-url/jELfnHtzuGxVtx7HDzYJSEDGFix.txt) (74.3 KB)

**Edit**  
I am thinking the original sin started with the conversion to two containers.

> [@Move from standalone container to separate web and data containers](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413/128):
>
> `./launcher bootstrap data && ./launcher destroy data && ./launcher start data`
> 
> fails with error unless first stopping the data container with `./launcher stop data`
> 
> This occurs on instances created fresh with `./discourse-setup --two-container` and converted using the longer method.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [February 17, 2026, 7:56pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/9 "2026-02-17T19:56:36Z")

</div>

> [@philh](#):
>
> `Bind for 0.0.0.0:80 failed: port is already allocated`

something on your server is already using port 80 and needs to be stopped

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 17, 2026, 8:02pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/10 "2026-02-17T20:02:25Z")

</div>

> [@philh](#):
>
> am thinking the original sin started with the conversion to two containers.

But you said that it had been working and you’d done several rebuilds.

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 8:47pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/11 "2026-02-17T20:47:28Z")

</div>

> [@supermathie](#):
>
> something on your server is already using port 80 and needs to be stopped

Discourse is the only thing on the server

> [@pfaffman](#):
>
> But you said that it had been working and you’d done several rebuilds.

I did and do 😀

There are three rebuild options in the original post. The one I reference has never worked .i.e. caused failure

> [@Move from standalone container to separate web and data containers](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413/128):
>
> `./launcher bootstrap data && ./launcher destroy data && ./launcher start data`
> 
> fails with error unless first stopping the data container with `./launcher stop data`
> 
> This occurs on instances created fresh with `./discourse-setup --two-container` and converted using the longer method.
> 
> In both cases  
> `./launcher stop web_only && ./launcher rebuild data && ./launcher rebuild web_only`  
> and  
> `./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only`
> 
> work as expected.

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 9:02pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/12 "2026-02-17T21:02:15Z")

</div>

> [@philh](#):
>
> > [@supermathie](#):
> >
> > something on your server is already using port 80 and needs to be stopped
> 
> Discourse is the only thing on the server

```plaintext
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1310/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 1316/docker-proxy

```

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 9:15pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/13 "2026-02-17T21:15:42Z")

</div>

Checking two other instances running separate containers… the message @pfaffman pointed out

Same result with `./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only`

```plaintext
Already up to date
╭ Warning ─────────────────────────────────────────────────────────────────────╮
│ │
│ Ignored build scripts: @swc/core@1.15.7, core-js@2.6.12, core-js@3.47.0, │
│ esbuild@0.25.12, esbuild@0.27.1, lefthook@2.1.0. │
│ Run "pnpm approve-builds" to pick which dependencies should be allowed │
│ to run scripts. │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
I, [2026-02-17T21:07:23.811289 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
Your Ruby version is 3.3.8, but your Gemfile specified ~> 3.4

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 17, 2026, 9:36pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/14 "2026-02-17T21:36:05Z")

</div>

> [@Move from standalone container to separate web and data containers](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413/128):
>
> `./launcher bootstrap data && ./launcher destroy data && ./launcher start data`

Yeah. That won’t work. It has never worked. I don’t know how someone suggested that it would. I don’t know how I didn’t notice that someone suggested that it would. And the point of the two-container setup, is that you mostly never upgrade data.

If you need to upgrade data, then you need to shutdown web only and then rebuild data, then web\_only. I updated the OP.

If you get port conflict errors then it’s likely because when docker restarted it first restarted the old app container and it’s what is grabbing the port. You can check with

```
docker ps

```

and see if `app` is running. You hope that it is, as that will explain the port issue.

You probably need to

```
 docker stop app; docker rm app

```

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 10:21pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/15 "2026-02-17T22:21:05Z")

</div>

Tallyho! Thanks @pfaffman

```plaintext
root@discuss:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f6dbb52ff74c local_discourse/data "/sbin/boot" 10 days ago Up 3 hours data
674e5e3fe5d8 local_discourse/app "/sbin/boot" 10 days ago Up 3 hours 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp app

```

Running  
`docker stop app; docker rm app`  
then  
`./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only`  
**works fine now**

I am very curious about the “hold” on app and why previous rebuilds worked fine. Very odd.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 17, 2026, 10:47pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/16 "2026-02-17T22:47:15Z")

</div>

> [@philh](#):
>
> am very curious about the “hold” on app and why previous rebuilds worked fine

You were just lucky, or more likely, docker hadn’t restarted, and it for some reason (an upgrade or machine reboot).

The ruby version error is a mystery to me.

---

<div class="post-metadata">

### Author: ![philh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philh/32/532740_2.png) [@philh](https://meta.discourse.org/u/philh)
#### Post date: [February 17, 2026, 11:00pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/17 "2026-02-17T23:00:36Z")

</div>

mysteries can be fun or …

At least now I can get back to implementing [AI](https://meta.discourse.org/t/post-flagging-duplication-and-spam-toxicity-combo/396067) and building out my political project

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 19, 2026, 11:00pm UTC](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317/18 "2026-03-19T23:00:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
