YunoHost-Apps / mastodon_ynh

Free, open-source social network for YunoHost
https://joinmastodon.org/
GNU Affero General Public License v3.0
84 stars 36 forks source link

Update Ruby to 3.2.3 #455

Closed nizarus closed 1 month ago

nizarus commented 2 months ago

Describe the bug

The Yunohost mastodon app is still using Ruby 3.2.2, but tootcl command needs 3.2.3 version. As workaround, we install Ruby 3.2.3 manually but after each upgrade the 3.2.3 version is removed and 3.2.2 version is installed.

Context

Steps to reproduce

$ sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh --debug
...
INFO Removing Ruby-3.2.3
INFO Installing Ruby 3.2.2
...
# RAILS_ENV=production bin/tootctl media usage
rbenv: version `3.2.3' is not installed (set by /var/www/mastodon/live/.ruby-version)

Expected behavior

Getting tootcl working.

nschiwy commented 2 months ago

While we're waiting for this to get merged, I wanted to see if you all could give me any advice on how to upgrade ruby manually on my setup. Whenever I try to run commands as the Mastodon user it tells me that rbenv is not found. I tried running some commands as root but I'm worried I just made things worse. My server just ballooned out of control without the pruning commands and I had to shut down all of the mastodon services until I can get Ruby working again.

elacheche commented 2 months ago

While we're waiting for this to get merged, I wanted to see if you all could give me any advice on how to upgrade ruby manually on my setup. Whenever I try to run commands as the Mastodon user it tells me that rbenv is not found. I tried running some commands as root but I'm worried I just made things worse. My server just ballooned out of control without the pruning commands and I had to shut down all of the mastodon services until I can get Ruby working again.

Hello,

Sorry for the delayed answer, here is how I do it, as root user:

source /etc/profile.d/rbenv.sh
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.2.3

Then tootctl should be good.

nschiwy commented 2 months ago

Thank you so much for posting this. I had to add /opt/rbenv/versions/3.2.3/bin to the PATH to make the commands work again but I'm finally back in business. I really appreciate it.

bigjdunham commented 3 weeks ago

I'm still having trouble with this even after the latest upgrade. The workaround suggested by @elacheche did not work for me. I'm getting a "/usr/bin/env: ‘ruby’: No such file or directory" when I try to use tootctl.

Tagadda commented 3 weeks ago

To use tootctl, you can use this:

# cd /var/www/mastodon/live
# sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/tootctl --help
nizarus commented 3 weeks ago

@bigjdunham which version you have ? I confirm that with 4.2.12~ynh1 version, tootcl is working from scratch.