Can't get Ruby to update so ./launcher rebuild app keeps failing

Hi there,

I have recently migrated a server image that has Docker Discourse installed on it

I can get everything up and running, but I need to re-issue the SSL cert

Since the old server had SSL configured, I’m following this guide’s suggestion and running
./launcher rebuild app

This then causes docker to pull and update a bunch of things. The current image is Discourse 2.6.0.beta3 - version 29f7e0689f61c5d85960a88f741ac3abced12d3e

The first time I ran it, it gave me the Postgres Upgrade message, so I ran ./launcher rebuild app again as instructed

Now it just keeps failing every time, I believe due to this error with an insufficient version of ruby installed

ERROR:  Error installing bundler:
	bundler-2.5.3 requires Ruby version >= 3.0.0. The current ruby version is

Here is the full output



Pups::ExecError: cd /var/www/discourse && gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock) failed with return #<Process::Status: pid 304 exit 1>

Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'

exec failed with the params {"cd"=>"$home", "hook"=>"web", "cmd"=>["gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,\"\"); print $0 }' Gemfile.lock)", "find $home ! -user discourse -exec chown discourse {} \\+"]}


** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

I would have thought Docker would update the Ruby version as needed?

I have tried manually logging into the container and install RVM, and activated Ruby v3+ but I still continue to get the same error

I’m a bit lost at this stage, and wonder is the version installed just too old to be upgraded with ./launcher?

Any advise would be greatly appreciated!

Just a note, that is not the error, the actual errors will be further up.


I recommend starting with a new image and doing a standard install.

1 Like

Thanks Jay, I feared that might be the only way forward

I guess I just need to find a way and hope I can copy across the database so everything isn’t lost

Try updating all your packages using apt upgrade

It’s not hard. You can just make a backup, or do Move a Discourse site to another VPS with rsync. You have nothing to lose since your existing site stays intact. It’s the safest possible way forward.

1 Like

I’ve updated absolutely everything I could, including the Ubuntu version of the server and confirmed I have ruby v3.1 running.

Problem is I suspect it’s the ruby version needed in the container which is controlled by docker, and I can’t seem to get it to update

I did manage to install a clean version and get it up and running 3.3.0.beta3-dev

However, when I restored the backup from the old site, it doesn’t look like it’s restored correctly and now the login page doesn’t work. Looking at the JS console there’s a Discourse is not defined error whenever I click the login/signup buttons. I reckon because of the big difference in versions it’s not a simple recovery of a 2.6.0 backup to a clean 3.3.0 install

Moving everything to a new server just isn’t working for me, as I can’t run ./launcher rebuild app without this ruby error blocking me each time.

If you’re running an upgrade that far it’s a good bet that your themes are broken. Try safe-mode.


Technically there is no 3.3.0 yet, we are still going through the betas.

1 Like

Thanks for the info, unfortunately when I try access /safe-mode it just redirects back to the /login url again.

I think I’ll try a re-install and start again

I did use the official discourse image but I guess that just installs the latest version regardless if it’s a beta. Or is there a way I can specify a stable or specific version?

Yes you can. Edit app.yml on a fresh install before building discourse (since you can’t downgrade). Pick the tag from GitHub. I had to do this some time ago when I had to restore to an old version before upgrading to the latest.

Now I make an image of the working version before I upgrade just case something went wrong.

Thank you, appreciate the help!

Good news is I managed to figure out how to install an older version of discourse_docker and the same version of discourse by changing the app.yml file

Bad news is I’ve ran into yet another error close to the end of the install

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 14351 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]} 

I’ll need to dig into that a bit more, looks to be more ruby/rails related in the container itself